Jump to content

update method - animation restarts when using .onDown


erich
 Share

Recommended Posts

Hi,

Hope someone can help

if I try to do a key press my animation stops until I let go of the key. (keys a and d) to move left and right - is there a way for the key press  .onDown to be used once or an aletrantive way to have my animation play when the key is held down, I've tried using the docs but can't seem to find a solution

eg demo below

http://html5gamer.mobi/2019/

code snippet when pressing d

if (this.keyRight.isDown){

                       this.player.anims.play('walkProper');

this.player.flipX = false;

this.player.setVelocityX(150);

}

Thanks in advance

Eric

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...