Search the Community
Showing results for tags 'player movement'.
I'm playing around with an infinite scroller game idea (think Temple Run) on the basis that the player stands still, and the terrain moves towards the camera, giving the illusion of forward motion. I added some simple random box meshes on top of the path that the user needs to navigate around (game over otherwise), and some gaps in the ground that the player can fall thru (game over). Since i need collision detection and basic player gravity I set up using CannonJS. That seems to work OK: the player would fall through the gaps, but for some reason the hit detection for the obstacles would bug
Currently, I have this script in my application to move the player in a circle using the mouse (taken from this example: http://phaser.io/sandbox/CpErwgAd/play) : var mouseX = this.input.x; var mouseY = this.input.y; theta = Math.atan2(mouseX-cX, mouseY-cY) var newX = Math.sin(theta) * radius; var newY = Math.cos(theta) * radius; rocket.x=cX + newX; rocket.y=cY + newY;I would like to change the above to key control ("A"/'D") -- but can't get the right code to work. FYI, I am using the cursor arrows for other movement with no problem. Any assistance would
I am building a game using a Tile Map. The Map loads and all appears fine. I can move the player right and left with no issues. Unfortunately, I have been unable to get movement up and down. I have scoured web with no success. I am not looking for 'Pac Man" auto movement. I want the player to move on keyboard input. Here is the relevant sections of code: this.physics.arcade.gravity.y = 200; // The player and its settings player = this.add.sprite(200, this.world.height - 250, 'dave'); // We need to enable physics on the player this.physics.arcade.enable(player); // Player