Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cursors = this.input.keyboard.createCursorKeys();
- if (cursors.left.isDown)
- {
- player.setVelocityX(-160);
- player.anims.play('left', true);
- }
- else if (cursors.right.isDown)
- {
- player.setVelocityX(160);
- player.anims.play('right', true);
- }
- else
- {
- player.setVelocityX(0);
- player.anims.play('turn');
- }
- if (cursors.up.isDown && player.body.touching.down)
- {
- player.setVelocityY(-330);
- }
Add Comment
Please, Sign In to add comment