I need help with movement

I need help with movement. With a,s, and d (left down right).

Update Script of the Character:
var speed = 7
if (isKeyDown(β€˜w’)){
this.y -= speed
}
if (isKeyDown(β€˜s’)){
this.y += speed
}
if (isKeyDown(β€˜d’)){
this.x += speed
}
if (isKeyDown(β€˜a’)){
this.x -= speed
}
//if I remember it correctly

how do i make the character do a walk cycle while moving?

Quick steps:

  1. Have the walk cycle animated
  2. Have a range where the walk cycle would be moving right
  3. Set another range where the player would face left/ up/ down
  4. Use this code: if(isKeyDown(β€˜right’/ β€˜left’){gotoAndPlay(# )};
  5. Probably none of this makes sense so feel free to look through this example:
    walk cycle for anyone who needs it.wick (185.6 KB)
    Feel free to use the same code or frames, and ur able to
    easily replace the current walk cycle animation with what
    u need : )

thanks i for telling me how to use a walk cycle

1 Like

i was typo