First, download the platformer game from the previous tutorial or Download Here.
Note:
If you want your actor to jump as many times as you want you want in
mid-air you do not need any self attributes. Just create a rule and say
when key up is down, change attribute self.motion.linearvelocityY to
500. The steps below are for people who want their actor on the screen
to jump once, land back down on the ground, then be able to jump again.
First, go into the player and create a new self integer attribute (name it jump). Keep the attribute number to 0.
Create
a rule, and we say when key up is down and self.jump is greater than 0,
change attribute self.motion.linearvelocityY to 500. Add another change
attribute behavior and change self.jump to (self.jump -1).
Create another rule, and we say when actor overlaps or collides with the ground, change attribute self.jump to 1.
You can change this to 2 or 3 or 4..... to make multiple jumps
Sorry no download this time.
Hope you learned from this!
CS Genius :)
No comments:
Post a Comment