How to make a character jump SOLVED

Started by personalinsanity, Mon 28/02/2011 15:37:06

Previous topic - Next topic

personalinsanity

I want to make my character be able to get on a bed and jump up and down a few times before getting off, but I cant figure out how. Any advice would be appreciated. Thanks.

Matti

You can either animate the character in a way that it looks like he's jumping or you can alter the character's z coordinate to elevate him off the ground.

mode7

Wait a minute..You want your character to jump up and down a few times...on a bed..before...getting of??? Waht kind of game are you making?  ;D

Sorry for that okay so you basically want to do an animation of a character jumping on a bed. You could just do this in your animation frames and play the animation a few times.
You could also move the player around like this:
Code: ags
 
int i;
while (i<5) {
player.Move (player.x, player.y-20, eBlock, eAnywhere); //This is probably what you're looking for most moves player up 20px
player.Move (player.x, player.y+20, eBlock, eAnywhere); //moves player down 20px
i++;
}


Makes the player jump 5 times.
This

personalinsanity

:D A very quirky game, hopefully.

Thank you for the code, I really appreciate it.

SMF spam blocked by CleanTalk