Search the Community

Showing results for tags 'jump'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 38 results

  1. Hi, In basic demos people use a variable like allowJump to prevent multiple jumping at the same time. For example, you start a jump - you are in the air, so you can't jump again until you are down. That's OK. What do I do if I'm on a mesh (allowJump is True), then move from it until falling down - while in the air allowJump is still True, but it must be False. How do I detect this falling down and prevent jumping? I don't use any physics plugin and for moving I use a camera with a mesh attached to it.
  2. Hello! I try to implement jumping without included physics plugin. I've read so many topics, but without the result I want. Here is a demo - Please press RUN, left click to enable moving with arrows and mouse - try to jump with Shift on the red box - you will fall down through it, but I want to stay ON it. I think I've enabled all checkCollicions, gravity etc, but still no luck. What am I missing? Maybe my jumping implementation is bad. At this moment I don't want to use a physics plugin because I think it's an overhead for me - I need moving and jumping only from a character at the moment.
  3. Hello, i created a litle game, based on the car demo in the playground, Now i have noticed that when i click with the mouse (left, middle, right) the car bounce a litle for and then back. also when the key is released. I have created an video: Have a look on the console. I dont think this is not an problem with my game logic, more with the canvas. Like you drag & drop the frame. Has anyone an similar problem or a fix for me ? I dont know what to do.
  4. Hi ! I'm new with phaser and i'm making a game, I have trouble with the double jump. I checked the others forum but it doesn't work with my game. I tried this and i checked the count of the jumps with an alert, and i see that it doesn't work bu i don't know why. // DOUBLE JUMP if (player.body.touching.down) // if player touch plateform, he gains his double jump { var jump = 2; } if (cursors.up.isDown && jump==2) { player.body.velocity.y = -400; //jump counter -1 jump--; alert(jump); } if (cursors.up.isDown && jump==1 ) { player.body.velocity.y = -400; jump--; alert(jump); } Thanks.
  5. Hi, I'm programming a simple platformer game, and I'm programming and setting the movement of the player. Here's my update function: update: function () { game.physics.arcade.collide(this.player, this.platform);; if(this.cursor.right.isDown){ this.player.body.velocity.x= 200;'correr', 5, true); this.player.scale.x=1; } else if(this.cursor.left.isDown){ this.player.body.velocity.x= -200;'correr', 5, true); this.player.scale.x=-1; } else if(this.jump.isDown && this.player.body.wasTouching.down) { this.player.body.velocity.y= -400 } else if((this.cursor.right.isDown || this.cursor.left.isDown) && this.jump.isDown){ this.player.body.velocity.x= 200; this.player.body.velocity.y=-200; } else{ this.player.body.velocity.x = 0; this.player.animations.stop(); this.player.frame = 4; } } Everything works fine, but in my last else if is suppose that the player should jump and walk, but it doesn't work! My intention is the player could jump while walking pressing the jump key + left or right key, for now I just can jump first and then walk. I don't know why this las if else it isn't being executed, because I tried to move it in the first if clause and it worked perfectly, but I can't realise about the error. Thanks for helping.
  6. Hi there, I'm creating a platformer game that is similar in art style and theme to Thomas Was Alone. I'm currently using the Phaser.ARCADE Physics system for my game cause it suits the theme well enough. However, I want to implement a jump mechanic that is similar that is similar to Thomas Was Alone. As of right now, my jump mechanics is a simple: if ((this.player.cursor.up.isDown) && this.player.body.onFloor()) { this.player.body.velocity.y = -300; } What do I do to make it feel less 'space-like' and more 'springy'??
  7. on tap

    I have a sprite jumping if the spacebar is pushed but i also want the same to happen on a mobile if the screen is tapped[Phaser.Keyboard.SPACEBAR]); cursors = this.input.keyboard.createCursorKeys(); this.jumpButton = this.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR) || this.input.onTap.add(onTap, this); what am i missing?
  8. Bad Pad now on Steam - Early Access

    Ever wonder what would happen if your gamepad's buttons came to life? Join square in his adventures, save Hexagon and Trapezoid from the hands of Evil Pen! Bad Pad is platformer game mixed with a little arcading, shooting, puzzle solving and metroidvania elements, that being said it is still a platformer, so expect a lot of jumping and fair amount of dying along the way. Bad Pad is available for Early Access on Steam now! Devblog, free demo, media kit and more can be found here.
  9. You are jumpy ape Joe! Collect all the bananas, get to the exit, and do it fast enough to get stars that help you unlock more characters! It features 30 levels with a variety of obstacles, 3 stars to unlock on each level and a total of 4 characters to play with. Available for licensing in HTML5 and Flash . You can play it also on Google Play with more levels and skins. For licensing please contact: zed [at] . You can also look at our HTML5 portfolio.
  10. Jumping

    I'm working on a endless runner as my first adventure into phaser but am having some trouble with getting my player sprite to jump. = function() {}; = { create : function() { // physics engine; = 500; // sprites this.ground =, 290,, 8, 'ground'); this.ground.autoScroll(-180, 0); this.player = this.add.sprite(45, 200, 'player'); this.player.animations.add('run');'run', 15, true); // physics on sprites[this.player, this.ground]); this.ground.body.immovable = true; this.ground.body.allowGravity = false; this.player.body.collideWorldBounds = true; // input cursors = game.input.keyboard.createCursorKeys(); jumpButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); }, update : function() {, this.ground); if (jumpButton.isDown && this.player.body.touching.down() && > jumpTimer) { player.body.velocity.y = -100; jumpTimer = + 500; } }, shutdown : function() { } } i think its a problem with the way i've write " this.player.bady.touching.down " but I've tried it a couple ways. I'm mostly new to JS so I'm sure its a me problem but some help would be greatly appreciated. Thank you.
  11. Hello. I'm working on a "jungle jump" phaser game and got stucked with it. The use case is very easy: there are some swinging ropes on the top of the screen (they are moving separately with a constant speed), and there is a "Monkey" which jump from one rope on other. When he fail the jump, falling down and waste a life. I found a way how can I generate and move the ropes. But I can't figure out how can move together the monkey and the rope and how can jump from one moving rope on other. Any code example would be helpful, or if have additional question feel free to ask. I found a picture which very similar to my game. p.s I have to say that I'm just now started with phaser.
  12. Pix Hop

    PIX HOP Hop, Bounce, Fall and Hop again ! Pix hop, simple endless platform game. You control a bouncy white square collecting coins and avoiding lovely colored enemies. [ Available on: GameJolt, , Newgrounds] Game supports GameJolt API , Don't forget to log in [ press G in Menu] with your Game Jolt account to Submit yourHighscore and achieve trophies [ Guests are allowed to submit scores make sure to change your name [press N in Menu ] Use Left and Right Arrows to Move [ Keyboard ] Use Left-Click Mouse to move [Mouse] Use Left and Right Arrows to Move [ Gamepad ] (Not compatible with all browsers) Waiting your feedbacks, suggestions and have fun playing Twitter: Facebook:
  13. To the moon jump! A game made in ~2 days for commisioned work for a cryptocoin promotion. It is a "Doodle jump" clone made in phaser for Web and Android support. You can play it here (warning, heavy advertising and promotion). I streamed on the whole development of this game, the related videos are the following: The nice thing about streaming is that you can see how much works can be packed in just 2 hours of highly focused work. 10/10 would do it again.
  14. Jump jump

    Hey everyone. I recently made a game called "Jump Jump" using Phaser framework. Its has simple rule, jump and don't get hit. mobile web friendly; coming to googleplay store and apple appstore soon! Any feedback is highly welcome, please enjoy! play!
  15. one jump.

    Hi, sorry for my bad english, but a can't find decision. I create standart platformer on phaser, javascript. I use arcade physic. After I pressed a jump button, my character jumps from the ground several times, while I release the button. I want its to jump once. I use this check to pressing: if (keyJump.isDown && player.body.wasTouching.down)
  16. Hi game devs!I would like to bring my first game to your attention. The game is called "Monster Jump - Galaxy" and currently designed for android devices, both phones and tablets.I've created it with Construct 2 and built for Android via CocoonJS cloud compiler, using Canvas+. It is available for free on Google Play: Gameplay:Just tilt your device and/or tap the screen to control. Jump from platform to platform, collect coins and power ups with cute space monster.Try to dodge from enemies or shoot them and jump higher and higher as you can. Monster Jump Galaxy is a good choice to play with friends and your family - who can get the highest score? Video of the gameplay available on Youtube. If you like this game, please don't forget to rate it 5 stars! Also, I'm glad to hear your comments here! Cheers!Denis
  17. Hi, Programming on my game, i came across a very strage behavoir. For some reason my body does not react to velocity. It can be set, but it does not have any effect. MoveLeft or MoveRight on the other hand works fine. Is this a commen bug, or am i just missing something? Help would be greatly appreciated. Here is some of the code I use: var player;var ground;var map;var levelLayer;var objectsLayer;var bg;var spikes;var collision_tiles;var move_distance = 50;var jump_height = 10000;var playState = { create: function() { // cursor cursors = game.input.keyboard.createCursorKeys(); // Create Background and fix camera on background bg = game.add.sprite(0, 0, 'background'); bg.fixedToCamera = true; // Create map from tileset and JSON & add Collision & add .png's map = game.add.tilemap('test2'); map.addTilesetImage('tiles_spritesheet','tiles'); map.addTilesetImage('magicBoni','magicBoni'); map.addTilesetImage('Map','Map'); map.addTilesetImage('spike-up','spike-up'); map.addTilesetImage('black-tiles64','black-tiles64'); // Add layers to map levelLayer = map.createLayer('Kachelebene 1'); levelLayer.resizeWorld(); map.setCollisionBetween(1,3000,true,levelLayer); // Create slope map var slopeMap = {'1':1,'2':1,'3':2,'4':3,'5':4,'6':5,'7':6,'8':7,'9':8,'10':9,'11':10,'12':11,'13':12,'14':13,'15':14,'16':15,'17':16,'18':17,'19':18,'20':19,'21':20,'22':21,'23':22,'24':23,'25':24,'26':25,'27':26,'28':27,'29':28,'30':29,'31':30,'32':31,'33':32}; collision_tiles =,levelLayer,slopeMap); // Player settings player = game.add.sprite(0, 20, 'player');,player.width/2);;; player.body.bounce.y = 0.8; = 0.3;; game.add.sprite(0, 0, 'foreground'); }, update: function() { for (var i = 0; i < collision_tiles.length; i++) {[i].tile); } if (cursors.left.isDown) { player.body.moveLeft(move_distance); } else if (cursors.right.isDown){ player.body.moveRight(move_distance); } // DOES NOT WORK! if (cursors.up.isDown && player.body.touching.down == true) { player.body.velocity.y = jump_height; } }}
  18. Player not jumping in platforms

    I'm having a problem in my game that i cant make my player jump when he is on an platform. Can anyone help me, here is the code (i dont know what part is wrong so i'll put the full code) Ps: I'm using phaser 2.3.0, and i dont speak english very well, so sorry if i write something wrong. game.physics.startSystem(Phaser.Physics.ARCADE); game.stage.backgroundColor = '#000000';, 0, 4000, 400); campo = game.add.tileSprite(0, 0, 4000, 400, 'fundo'); cursors = game.input.keyboard.createCursorKeys(); jumpButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); game.physics.arcade.gravity.y = 100; player = game.add.sprite(100,300 , 'boneco'); game.physics.arcade.enable(player) player.body.collideWorldBounds =true; player.animations.add('frente' , [0,1,2], 4); player.animations.add('tras' , [3,4,5], 4); player.animations.add('puloe' , [6]); player.animations.add('pulod' , [7]); player.animations.add('parado' , [8]);; platforms = this.add.physicsGroup();platforms.create(50, 350, 'terra');platforms.create(200, 180, 'terra');platforms.create(400, 296, 'terra');platforms.create(600, 412, 'terra');platforms.setAll('body.allowGravity', false);platforms.setAll('body.immovable', true);platforms.setAll('body.velocity.x', 0)platforms.setAll('body.velocity.y', 0)platforms.setAll('body.collideWorldBounds', true); }, update: function () { player.body.bounce.y = 0.2; player.body.gravity.y = 200; player.body.velocity.x = 0; if (cursors.left.isDown) {player.body.velocity.x = -150; if (facing != 'left') {'tras'); facing = 'left'; }} else if (cursors.right.isDown) {player.body.velocity.x = 150; if (facing != 'right') {'frente'); facing = 'right'; } } else {if (facing != 'idle') {'parado'); facing = 'idle';}} if (jumpButton.isDown && player.body.onFloor() && > jumpTimer) { player.body.velocity.y = -250; jumpTimer = + 750;} if (jumpButton.isDown && player.body.onFloor() && > jumpTimer) { player.body.velocity.y = -250; jumpTimer = + 750;} game.physics.arcade.collide(platforms, player)
  19. In my code, I have a ground, and some ledges. On pressing up arrow, I want my player sprite to jump only if he is on the ground or a ledge. I added the code: if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -250; } as I saw in phaser's official first tutorial. This is working for the ground but not for the ledges. When the player is on a ledge, the up arrow doesn't make the sprite jump. In my game, I have not added them to the same group. Is that why this is happening? This is the related code: platforms =; platforms.enableBody=true; var ground = platforms.create(0, - 64, 'ground'); ground.scale.setTo(2, 2); ground.body.immovable = true; ledges =; ledges.enableBody = true; ledges.body.immovable = true; player = this.add.sprite(32, - 150, 'dude'); //enable physics on the player this.physics.arcade.enable(player);cursors = this.input.keyboard.createCursorKeys(); this.timer =, this.drawLedge, this); var rand = Math.floor(Math.random() * 4500)+100; this.time2 =,this.drawHelp,this);update: function() { this.physics.arcade.collide(player,platforms); this.physics.arcade.collide(player,ledges); player.body.velocity.x = 0;'right'); if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -250; } },drawLedge: function() { var ledge_y = Math.floor(Math.random()*; var ledge = ledges.create(,ledge_y,'ledge'); ledge.anchor.setTo(0.5); ledge.checkWorldBounds = true; ledge.kilOutOfBounds = true; ledge.body.velocity.x=-150; }, drawHelp: function() { var helper = ledges.create(, Math.floor(Math.random()*,'ledge'); helper.anchor.setTo(0.5); helper.body.velocity.x = -150; helper.checkWorldBounds = true; helper.kilOutOfBounds = true; },Am I missing something?
  20. Tilesprite collision issue

    Hi guys! I'm currently having an issue with using a tilesprite as the ground for an infinite runner game. Using Arcade physics I set a body to the tilesprite so that I could check collision between my sprite and the ground. The problem comes when the collision actually happens. The sprite body doesn't flag "body.touching" as down nor does it work with "body.onFloor()". A by-product of this issue is that my jump function is negated for some reason. Once my sprite collides with the ground he can't move up at all. Any help would be appreciated!! This is my main game state: Play = function(game) { = game; this.boy = new Player(game); this.girl = new Girl(game); = null; this.ground = null;}Play.prototype = { create: function() { =, 0, 438, 136, 'background'); this.ground =, 125, 438, 44, 'ground');; this.ground.body.allowGravity = false; this.ground.body.immovable = true; this.ground.body.setSize(this.ground.width, this.ground.height - 10, 0, 10); this.boy.create(); this.girl.create(); }, update: function() { -= 0.5; this.ground.tilePosition.x -= 1.5; this.boy.update(); this.girl.update();, this.ground); }And here is my player class: Player = function(game) { = game; this.player = null; this.cursors = null;}Player.prototype = { create: function() { this.player = / 2, / 2, 'boy') this.player.anchor.setTo(0.5, 0.5); this.player.scale.setTo(0.5, 0.5);; this.player.body.collideWorldBounds = true; this.player.animations.add('run', ['run1', 'run3', 'run2', 'run4'], 8, true, false); this.player.animations.add('jump', ['jump1', 'jump2'], 5, false, false); this.player.animations.add('fall', ['fall1', 'fall2', 'fall3'], 8, false, false); this.cursors =; }, update: function() { this.player.body.velocity.x = 0;'run'); if (this.cursors.left.isDown) { this.player.body.velocity.x = -100; } else if (this.cursors.right.isDown) { this.player.body.velocity.x = 100; } if (this.cursors.up.isDown) { this.player.body.velocity.y = -200;'jump'); }Here is a live version: Thanks in advance!!
  21. Hello. I am new at Phaser and i am now developing simple JavaScript game. Here is the code. I want to implement die function when the hero fall to the ground from some distance (600px for example). Can someone help me with this because i searched for functions like this in phaser but i didn't manage to find something like that. The other question is how to make points system (collect points if the hero moves up on the platforms and loose the points he earned if he drop down on lower platform?
  22. How can I make a jump on P2?

    Can anyone guide me the way to do a jump on P2? I have read this article about the jump on P2, but what I actually wanted is that: I want to jump depend on how I press the key : example: if I press slightly, it will jump a little and if I press hardly, it will jump high. please give me a demo. Thanks you for helping.
  23. Jump problem

    Hello. First of all, I would like to apologize about my poor english, which did not allow me to make a decent search (i tried to find another topic with the same query, but they were different in some way, as this one: I'm really sorry if i'm creating an already answered topic =( THE PROBLEM: Easy for you. I was following this code: I can't explain why I couldn't get my player to jump. The code was identic... after many tries I just copy/paste the code from the example. Nothing. Can you help me? It's probably one of the silliest questions you have seen here, so forgive me. THE CODE: function carregaAssets() { //Carregando o cenário game.load.tilemap('map', 'assets/untitled.json', null, Phaser.Tilemap.TILED_JSON); // Carregando a imagem base (tilemap) do mapa: game.load.image('tilesCenario', 'assets/novo2.png'); // Carregando a imagem de fundo - bg.png: game.load.image('fundo', 'assets/bg.jpg'); // Adiciona sprites do jogador: game.load.spritesheet('dude', 'assets/dude.png', 32, 48); }var map;var layerMap1;var layerMap2;var player;var cursors;var jumpButton;var facing = 'left';var jumpTimer = 0;function criaCenario() { // Cria o background: criaFundo(); // Inicia a física no jogo: game.physics.startSystem(Phaser.Physics.P2JS); // Início do processo de mapeamento - Variável recebe o arquivo JSON 'map': map = game.add.tilemap('map'); // Insere o Tilemap (imagem) dentro dos parâmetros JSON: map.addTilesetImage('novo2', 'tilesCenario'); // Cria as layers do cenário com o mesmo nome do TILED: layerMap1 = map.createLayer('camada1'); layerMap2 = map.createLayer('Colisao'); layerMap1.resizeWorld(); layerMap2.resizeWorld(); // Criando colisões no cenário: map.setCollision(79); // Transformando tilemaps de colisão em objetos (CORPO): game.physics.p2.convertTilemap(map, layerMap2); // MUDAR DEPOIS game.physics.p2.restitution = 0.5; game.physics.p2.gravity.y = 300; // Chama função Jogador criaPlayer(); // Configura os botões de movimentação: cursors = game.input.keyboard.createCursorKeys(); jumpButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); }function atualizaJogo() { if (cursors.left.isDown) { player.body.moveLeft(200); if (facing != 'left') {'left'); facing = 'left'; } } else if (cursors.right.isDown) { player.body.moveRight(200); if (facing != 'right') {'right'); facing = 'right'; } } else { player.body.velocity.x = 0; if (facing != 'idle') { player.animations.stop(); if (facing == 'left') { player.frame = 0; } else { player.frame = 5; } facing = 'idle'; } } if (jumpButton.isDown && > jumpTimer && checkIfCanJump()) { player.body.moveUp(300); jumpTimer = + 750; }}//######################FUNÇÕES EXTRAS #############################function criaFundo(){ bg = game.add.tileSprite(0, 0, 800, 520, 'fundo'); bg.fixedToCamera = true;}function criaPlayer(){ player = game.add.sprite(100, 200, 'dude'); player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('turn', [4], 20, true); player.animations.add('right', [5, 6, 7, 8], 10, true); game.physics.p2.enable(player); player.body.fixedRotation = true; // player.body.setMaterial(characterMaterial);;}function checkIfCanJump() { var yAxis = p2.vec2.fromValues(0, 1); var result = false; for (var i = 0; i <; i++) { var c =[i]; if (c.bodyA === || c.bodyB === { var d =, yAxis); // Normal dot Y-axis if (c.bodyA === d *= -1; if (d > 0.5) result = true; } } return result;}function render() {}Thanks a lot, and sorry again...
  24. Hi all, i'm happy to tell you that my first game now available on Google Play. (Thanks Phaserjs and Ludei) Dash Runner 2 is classic yet crazy go-to-distance highscore game with a new TWIST. The game feature both single player and multiplayer on a single mobile screen. You must be control not one but TWO characters at the same time. JUMP your way out of all the holes on the ever SPINNING racing track, don't ever let gravity stop your runs. You can download here : Some screenshots Thanks!
  25. Hi! I have just released my first game made using Pixi.js. It's a really simple app that's similar to those runner games on the marketplace, but this one comes with some special moves and controls that make it stand out a little. Here's a brief description of it, hope you guys like it! JumpSlide Boy Combine your moves to get as far as you can in this survival run between boxes! Game Features: - Simple but innovative controls: tap on the upper or lower half of the screen to perform your moves! - Quick runs are fun and straightforward, but to break records you need to master your reflexes! - Cute graphics: a bright and funny world will make you never lose hope! - Day/night cycle: as you keep running, the time of day will pass and your visibility may become limited, making your runs even harder! You can check it out here: Android, iOS (NOTE: It's been just released a day ago and it will be available on iOS aswell but it's still in the review process, so sorry about that but I promise I'll update it with a link once it's done!)