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

#1 2009-10-13 07:55:10

thisisalecks
Scratcher
Registered: 2009-10-13
Posts: 4

Need Help

I'm trying to make one of the characters in my game to jump. I've tried other peoples skripts, but it hasn't seemed to work. Any suggestions? Please check out the game on my page.
Greatly appreciated (:

Offline

 

#2 2009-10-13 09:08:01

jacool
Scratcher
Registered: 2008-01-25
Posts: 1000+

Re: Need Help

When Green Flag Clicked:
     forver
           if (up arrow) and (touching color "color")
                Repeat(10)
                    Change Y by (4)
     repeat until (touching color "color")
          Change y by -4


That was a basic Jump and Gravity script here's a smoother one using variables:

When Green Flag Clicked:
Set VarY to (0)   
      forver
           if (up arrow) and (touching color "color")
                Repeat(7)
                    Change VarY by (2)
     repeat until (touching color "color")
          Change VarY by (-0.5)
    Set VarY to (0)

When Green Flag Clicked:
     Forever change Y by VarY


I hope that helped, please reply if anything's unclear or if the code doesn't work.


http://i571.photobucket.com/albums/ss159/JacobKar/svensktiger-1.png

Offline

 

#3 2009-10-13 09:48:06

jacool
Scratcher
Registered: 2008-01-25
Posts: 1000+

Re: Need Help

And by the way this should be moved to "all about scratch"
Hello, MyRedNeptune are you there? Please come here and move it  big_smile

Last edited by jacool (2009-10-13 09:48:28)


http://i571.photobucket.com/albums/ss159/JacobKar/svensktiger-1.png

Offline

 

#4 2009-10-15 09:30:41

thisisalecks
Scratcher
Registered: 2009-10-13
Posts: 4

Re: Need Help

I tried doing it, but there's some confusion. Is there anyway for you to actually show me with a picture?

Offline

 

Board footer