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:
- Have the walk cycle animated
- Have a range where the walk cycle would be moving right
- Set another range where the player would face left/ up/ down
- Use this code: if(isKeyDown(βrightβ/ βleftβ){gotoAndPlay(# )};
- 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