Jump to content

Search the Community

Showing results for tags 'Phaser keyboard movement'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello! I want to create full keyboard movement in my game but i have a problem. I am trying and trying a lot of way and nothing. Now i ended on this: if(this.cursors.left.isDown) { this.player.animations.play('left'); this.lastanimation = 'left'; this.player.body.velocity.x -= 70; } else if(this.cursors.right.isDown) { this.player.animations.play('right'); this.lastanimation = 'right'; this.player.body.velocity.x += 70; } else if(this.cursors.up.isDown) { this.player.animations.play('up'); this.lastanimation = 'up'; this.player.body.velocity.y -= 70; } else if(this.cursors.down.isDown) { this.player.animations.play('down'); this.lastanimation = 'down'; this.player.body.velocity.y += 70; } else { this.player.animations.stop(); this.player.frame = 0; } },Want to move my sprite in 4 directions , and when holding the one arrow , I would like to push the second and chenge sprite direction . Now that I have, but not quite. Holding the left arrow and press the down sprite still goes to the left , but holding down and pressing the left nice change direction. I know that is because IF and else is conditional, but maybe anyone have way to do good keyboard movement with animations? How it work you can look on my page : http://lifetime.cba.pl LOGIN : test PASSWORD : test. Then click "GRAJ" to load the game. I will be grateful for help.
×
×
  • Create New...