Jump to content

Search the Community

Showing results for tags 'cursors'.

  • 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 guys, I am new to Phaser and programming in general. I encountered a problem while setting up the cursor controls for my player. The idea is for the player to shoot a bullet in the direction the player is pointing or running to, even while jumping. If i press the right-key and up-key at the same time and fire a bullet, everything works just fine. However, if I press the left-key and up-key at the same time and fire a bullet, the bullet does not fire. What is interesting is that If I hold the left-key and up-key at the same time and fire the bullet, the bullet fires, working just fine using the Numpad on the very same keyboard. So I thought I had a faulty keyboard and tried a different one, but I came up with the same results. Since I am new to Phaser, I am wondering If I am not doing something correctly? It would be nice to be able to use the specified key arrows instead of the numpad. For those interested, this is the part of the code that deals with the cursor mechanics (again, this code works just fine on the numpad): if (this.cursors.left.isDown) { if(this.fireButton.isDown){ this.fireBulletLeft();} this.player.body.velocity.x = - 150; this.player.animations.play('left'); } if (this.cursors.right.isDown) { if(this.fireButton.isDown ){ this.fireBulletRight();} this.player.body.velocity.x = 150;this.player.animations.play('right'); } if (this.cursors.up.isDown && this.player.body.touching.down) { this.player.body.velocity.y = -350; }
×
×
  • Create New...