Jump to content

Search the Community

Showing results for tags 'keys'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 10 results

  1. Hi, I'm programming a simple platformer game, and I'm programming and setting the movement of the player. Here's my update function: update: function () { game.physics.arcade.collide(this.player, this.platform); game.camera.follow(this.player); if(this.cursor.right.isDown){ this.player.body.velocity.x= 200; this.player.animations.play('correr', 5, true); this.player.scale.x=1; } else if(this.cursor.left.isDown){ this.player.body.velocity.x= -200;
  2. In my main scene I add keyboard event listeners to specific keys in the init() state. Also some of those keys need to be disabled at specific time and re-enabled at specific time. How can I disable/enable input on specific keyboard buttons at runtime?
  3. Hi, Often I come with the "problem" that I start a game using separated images and later I pack them in a texture atlas. I say a problem because when you create the sprites from separated image files yo do something like this: // load the single image filesgame.load.image("bird", "assets/bird.png");game.load.image("dog", "assets/dog.png");...// create the sprites using the images keysgame.add.sprite(10, 10, "bird");game.add.sprite(20, 20, "dog");Ok, but when I decide to migrate the game to use texture atlas I come with the problem that my "create" code gets broken, why? because I should us
  4. 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.veloc
  5. Hello! I've got a question about the v3 assetloader/resourceloader: After loading an asset like such: var loader = PIXI.loader;loader.add('img',"assets/image.jpg");.. can I access the resource with (what I assume is ) the key? Edit: posted it wrong the first time In other words? Is there a way to do this: var sprite = PIXI.Sprite.fromFrame("img");..instead of what I'm doing currently: var sprite = PIXI.Sprite.fromFrame("assets/image.jpg");appreciated as always!
  6. Hi guys, I'm really new to Phaser and programing in general so I'm getting stuck really often with my first game. What I'm trying to do is some sort of a two players fighting game (this is a game for gamepads and keyboards, no mobile here). I kinda have the basics going, I mean, my characters move! But i have a list of things to do that keeps growing! Here I have my first two problems for you, kind people: Problem number 1: The thing I'm trying to do is to have my character perform a special move with a combination of buttons. I'm guessing there should be a timer involved somehow. The id
  7. Hey guys, I'm trying to code a pause function into my little game. I already read the other treads about this topic. I found no way to disable only particular keys, like the cursors, while game is paused. My code: pauseGame: function() { pauseSound.play(); this.paused = !this.paused; if (this.paused) { level.pause(); player.pause(); } else { level.resume(); player.resume(); } }And inside Player.js: pause: function() { this.game.input.keyboard.removeKey(Phaser.Keyboard.UP); }, resume:
  8. Hi Im not sure if this is possible but for example if you hold the up and right arrow keys the player moves north east. Ive been trying to code this but just can't. Please Help Thanks.
  9. Does anyone have any issues using phaser with some other plugin or API? I'm using phaser+Samsung API and seems Phaser is overlapping the TV Keys. An evidence at first glance is that is not given the correctly key from Phaser to TV, so that I can't handle it. Just to share that situation using Phaser and 3rd part libraries.
  10. Hi. I'm trying to move my space jet so that way it is facing the left when I move the arrow key left, and it is facing right when I move the arrow key right. Any help would be greatly appreciated. Thanks. Here's my code in Javascript: var canvasBg = document.getElementById('canvasBg');var ctxBg = canvasBg.getContext('2d');var canvasJet = document.getElementById('canvasJet');var ctxJet = canvasJet.getContext('2d');var jet1;var gameWidth = canvasBg.width;var gameHeight = canvasBg.height; var fps = 10;var drawInterval;var imgSprite = new Image();imgSprite.src = 'sprite.png';imgSprite.addEventL
  • Create New...