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

#1 2011-11-11 16:01:22

AnimatorDominator
New Scratcher
Registered: 2011-08-25
Posts: 4

Jumping help

What is a good script to make your sprite jump?

Offline

 

#2 2011-11-11 17:07:40

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

Re: Jumping help

In short, it depends on what other movement script you have.  Do you require the sprite to not be touching the ground, but to be hovering slightly over it?  Do you want realistic gravity (in other words, velocity)?  Do you want to use sensor sprites/costumes?  Do you want the sprite to "jump" or just teleport higher?  If you answered yes to any of those questions, it will become more difficult.  If you answered no to all of them:

Code:

When Flag Clicked
Forever
     if<touching ground>
     {
          if<key up arrow pressed>
          {
               change y by 50
          }
     }
     else
     {
          change y by -5
     }
}

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

Offline

 

Board footer