Jump to content

Search the Community

Showing results for tags 'multiple keys at once'.

  • 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 want multiple keys at once. If I use D + shift, the player will stop, how to fix it? SHIFT is to sprint the player and D is to walk the player on right side. This is my code: (game.input.keyboard.isDown(Phaser.Keyboard.A)) { if(carDriveV != 0) { car_1.body.velocity.x = -50; car_1.animations.play('c_drive'); } else if (boatDrive != 0) { boat.body.velocity.x = -50; facing = 'left'; boat.animations.play('boat_move_l'); } else { player.body.velocity.x = -50; if (facing != 'left') { player.animations.play('left'); facing = 'left'; } } } else if (game.input.keyboard.isDown(Phaser.Keyboard.D)) { if(carDriveV != 0) { car_1.body.velocity.x = 200; car_1.animations.play('c_drive'); } else if (boatDrive != 0) { boat.body.velocity.x = 50; facing = 'right'; boat.animations.play('boat_move_r'); } else { player.body.velocity.x = 50; if (facing != 'right') { player.animations.play('right'); facing = 'right'; } } } else if (game.input.keyboard.isDown(Phaser.Keyboard.SHIFT)) { if(carDriveV != 0) { carDriveV = 0; player.loadTexture('player'); game.camera.follow(player); player.body.x = car_1.body.x+130; } else if (boatDrive != 0) { } else { if (facing == 'left') { player.animations.play('sprint_left'); facing = 'left'; player.body.velocity.x = -150; } else { player.animations.play('sprint_right'); facing = 'right'; player.body.velocity.x = 150; } } }
×
×
  • Create New...