How do i make my character jump and crouch in a game?!?!?!?!


#1

I am making a game where a stickman is running and dodging obstacles. How do I make him jump and crouch on command?

PLEASE HELP ME


#2

Here’s an interactive stick figure that can run, jump, crouch. Let me know if this works.

interactiveStickFigure-Nov30-2018-4.34PM.html (828.6 KB)


#3

I cant view the file because I am working from my school computer, can you send me the code?


#4

Here’s the code this project uses. Unfortunately, you also need a clip which is designed for this code for it to work.

function keyDown(key) {
if (key === "RIGHT") {
    this.gotoAndStop("run");
} else if (key === "UP") {
    this.gotoAndStop("jump");
} else if (key === "DOWN") {
    this.gotoAndStop("crouch"); 
}

}

function keyReleased() {
    this.gotoAndStop("idle"); 
}

#5

How can I make this work for my project?