Jump to content

Search the Community

Showing results for tags 'Phaser .isDown Bug'.

  • 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. I seen to have hit a major problem... I believe it is a phaser issue but not really sure. If I hold down several keys, like Q and Z, then try to press W, F, H, etc. randomly some keys seem to not be triggered. update: function () { //Check player movements this.CheckPlayersControls(); }, CheckPlayersControls: function () { //Check player 1 movement this.CheckPlayersInput(this.spritePlayer1, this.Cursors.left.isDown, this.Cursors.right.isDown, this.Cursors.up.isDown, this.Cursors.down.isDown, this.input.keyboard.isDown(Phaser.Keyboard.Z), this.input.keyboard.isDown(Phaser.Keyboard.X), 0); //Check player 2 movement this.CheckPlayersInput(this.spritePlayer2, this.input.keyboard.isDown(Phaser.Keyboard.A), this.input.keyboard.isDown(Phaser.Keyboard.D), this.input.keyboard.isDown(Phaser.Keyboard.W), this.input.keyboard.isDown(Phaser.Keyboard.S), this.input.keyboard.isDown(Phaser.Keyboard.Q), this.input.keyboard.isDown(Phaser.Keyboard.E), 1); //Check player 3 movement this.CheckPlayersInput(this.spritePlayer3, this.input.keyboard.isDown(Phaser.Keyboard.F), this.input.keyboard.isDown(Phaser.Keyboard.H), this.input.keyboard.isDown(Phaser.Keyboard.T), this.input.keyboard.isDown(Phaser.Keyboard.G), this.input.keyboard.isDown(Phaser.Keyboard.R), this.input.keyboard.isDown(Phaser.Keyboard.Y), 2); //Check player 4 movement this.CheckPlayersInput(this.spritePlayer4, this.input.keyboard.isDown(Phaser.Keyboard.J), this.input.keyboard.isDown(Phaser.Keyboard.L), this.input.keyboard.isDown(Phaser.Keyboard.I), this.input.keyboard.isDown(Phaser.Keyboard.K), this.input.keyboard.isDown(Phaser.Keyboard.U), this.input.keyboard.isDown(Phaser.Keyboard.O), 3); }, CheckPlayersInput: function (spritePlayerNumber,keyLeft,keyRight,keyUp,keyDown,keyShoot1,keyShoot2,intPlayerIndex) { //Stops player when not moving anymore spritePlayerNumber.body.velocity.x = 0; spritePlayerNumber.body.velocity.y = 0; //Movement left or right switch (true) { case keyLeft: { spritePlayerNumber.body.velocity.x = -spritePlayerNumber.speed; break; } case keyRight: { spritePlayerNumber.body.velocity.x = spritePlayerNumber.speed; break; } } //Movement up or down switch (true) { case keyUp: { spritePlayerNumber.body.velocity.y = -spritePlayerNumber.speed; break; } case keyDown: { spritePlayerNumber.body.velocity.y = spritePlayerNumber.speed; break; } } //Shooting 1 if (keyShoot1) { //this.fire(spritePlayerNumber, intPlayerIndex); NOT USED YET BECAUSE OF THIS PROBLEM } //Shooting 2 if (keyShoot2) { //this.beam(spritePlayerNumber, intPlayerIndex); NOT USED YET BECAUSE OF THIS PROBLEM } }, Makes no sense to me, it is a simple sub... I can move the players individually no problem, issues occur when holding down several keys. I tried console.log and it seems the input returns false even if certain keys are held down.
×
×
  • Create New...