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

#1 2012-10-02 16:24:11

Aquatic
New Scratcher
Registered: 2012-10-01
Posts: 4

Help!

Hello. I'm making a platformer game, and I'm stumped on a script, and I do not know how to fix it. I'm trying to make a working jumping script, but it seems to not be working. The way it's not working is the fact that the player you control stays in the air if you hold the up arrow key.

Can somebody please post a script that will help me have a working jumping script? Thank you in advance.

Offline

 

#2 2012-10-02 16:38:49

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

Re: Help!

Something like this:

when gf clicked
set [y-vel v] to (0)
forever
if<touching [ground v]?>
set [y-vel v] to (0)
if<key [up arrow v] pressed?>
set [y-vel v] to (5)
end
else
change [y-vel v] by (-.2)
end
change y by (y-vel)


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

Offline

 

#3 2012-10-02 16:45:21

Aquatic
New Scratcher
Registered: 2012-10-01
Posts: 4

Re: Help!

Thanks, I'll try that!

Offline

 

#4 2012-10-02 18:13:33

Aquatic
New Scratcher
Registered: 2012-10-01
Posts: 4

Re: Help!

Ah, didn't work. The sprite just floated up to the top and stayed there.

Offline

 

#5 2012-10-02 18:16:43

Aquatic
New Scratcher
Registered: 2012-10-01
Posts: 4

Re: Help!

Oh! I managed to make a working jump script. Thanks for trying to help though!  smile

Offline

 

Board footer