A character jumps up off a platform, and return under the influence of gravity – you cannot jump from midair
Information about object: guy
Sprite: guy
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Mask:
Step Event:
If relative position (0,1) is collision free for Only solid objects
set the gravity to .75 in direction 270
//if there is no wall underneath the object, set gravity
else
set the gravity to 0 in direction 270
//if there is a wall under the object, destroy the gravity
if vspeed is larger than 12
set variable vspeed to 12
//if the object moves too fast, set the speed back to a slower realistic speed.
Collision Event with object wall:
move in direction direction at most 12 till a contact with solid objects
set the vertical speed to 0
// stop the gravity if it is touching the wall. Also makes it sit on the wall, not above it.
Keyboard Event for Key:
if relative position (-4,0) is collision free for Only solid objects
move relative to position (-4,0)
// Makes the object be able to move on the platform.
Keyboard Event for Key:
if relative position (0,1) gives a collision with Only solid objects
set the vertical speed to -10
// Makes the object jump up.
Keyboard Event for Key:
if relative position (4,0) is collision free for Only solid objects
move relative to position (4,0)
stefen’s file helped me big time and so did another student’s blog (not sure who), and kingy helped with touch ups as this is in his game