Jump to content


Photo

Moving and falling trouble


  • Please log in to reply
No replies to this topic

#1 Dragon Star

Dragon Star

    GMC Member

  • New Member
  • 149 posts

Posted 02 December 2010 - 01:43 AM

I have multiple player objects since there's a different sprite for each part of jumping. On the animation end of each jumping object, I have it change to the next object in the sequence, and of course I have the vspeed and gravity on them. When it hits the platform I have it change back to the standing object.

Jumping works perfectly, but moving and falling off platforms doesnt.

STANDING OBJECT(*=left or right, ~=plus sign or minus sign, the instance change in Step is the last jumping object, the instance change in Press up is the first jumping object.)
Step:
if
place_free(x,y)
then
instance_change(obj_jump4*, true)

Press up:
instance_change(obj_jump1*, true)

Keyboard right/left(moving):
sprite_index=spr_walk*
hspeed~=5

Keyboard right/left(turning)
instance_change(obj_stand*, true)

Release right/left
sprite_index=spr_stand*
hspeed=0

Edited by Dragon Star, 02 December 2010 - 01:46 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users