This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-05 07:54:25

OCE4point5
New Scratcher
Registered: 2012-01-08
Posts: 3

Jumping

I need to make a jumping character and I would like it if it could jump in a  parabolic arc. I'm not sure how to make it follow that path. Any ideas?

Offline

 

#2 2012-03-05 16:41:31

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Jumping

You need to use y-velocity.   Here is a tutorial I made on basic movement.  Here is the basic y-velocity:

forever
if<key [up arrow] pressed?>
set [y-velocity] to (5)
end
if<not <touching [ground]?>>
change [y-velocity] by (-.2)
else
set [y-velocity] to (0)
end
change y by (y-velocity)
end
Of course that script is far from perfect (you'll probably end up stuck in the ground), so if you want to see usable script, I'd recommend clicking on the link above.

Edit: If you move at a constant x-velocity that will make a parabolic arc.  If you change your x-velocity, jumping in a parabolic arc is really impossible (move forward and jump, then, in mid-jump, if you stop, you'd have to stop falling xD )

Last edited by MoreGamesNow (2012-03-05 16:43:02)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer