vernonr Posted November 29, 2014 Share Posted November 29, 2014 Hello again. New problems arise everyday! I have a character who has an animation called "hit". Here's the strip of frames. So in my code I have this little something that makes the character "hit" when the btnGolpe is down: btnGolpe = game.input.keyboard.addKey(Phaser.Keyboard.M); in function update (): else if (btnGolpe.isDown) { player.animations.play('golpe'); } The problems?1) The animation keeps looping if btnGolpe is down. It should only play once per button pressing.2) I need that the character actually "hits" it's opponent with his fist. Is there a way to do this? The collision should be between the fist and the opponent. Bare in mind that the fist is shown in one frame of the whole animation, so it show only register the collision in that frame, in that position (the fist, in this case). I'm really looking forward for your advise on these things. Thanks in advance, people! Link to comment Share on other sites More sharing options...
Recommended Posts