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

#1 2012-05-28 14:45:19

8Bits
Scratcher
Registered: 2012-05-26
Posts: 16

gravity fall

Okay. I am making this game where you are a robot, and I am making this smooth sort of jumping thing, but he keeps falling into the ground instead of staying on top. Here's my jumping script:

when gf clicked
forever if <key [up arrow v] pressed?>
repeat (10)
change y by (7)
end
repeat (7)
change y by (5)
end
repeat (4)
change y by (3)
end
end


http://scratch.mit.edu/static/projects/8Bits/2567025_sm.png
The Jungle Game!      "...the graphics...they are amazing" SlipGrippz                            "Yea, its really good." WilliamEPJ                                                                                 36 views, 3 love-its, and 12 downloads

Offline

 

#2 2012-05-28 15:06:11

wasabi56
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: gravity fall

8Bits wrote:

Okay. I am making this game where you are a robot, and I am making this smooth sort of jumping thing, but he keeps falling into the ground instead of staying on top. Here's my jumping script:

when gf clicked
forever if <key [up arrow v] pressed?>
repeat (10)
change y by (7)
end
repeat (7)
change y by (5)
end
repeat (4)
change y by (3)
end
end

Okay, is there a gravity that takes the sprite down after the jump that also stops it from going through the ground, like:

when gf clicked
forever
if <touching color[color of ground]?>
change y by (5)
end
if <not <touching color[color of ground]?>>
change y by (-5)
end


http://i.picasion.com/pic58/c23d4d2fc75f459dcf3d9ebf3e8ba395.gif
http://www.weebly.com/uploads/1/0/1/4/10146167/2294523_orig.png

Offline

 

#3 2012-05-30 02:46:49

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: gravity fall

There are many ways to do it, but I've never found a perfect one, so wasabi's script will definitely work. Besides, your script may have worked, but there is no way to come down, only up.


Why are the secret organizations getting all the attention?  mad

Offline

 

#4 2012-05-31 19:24:25

8Bits
Scratcher
Registered: 2012-05-26
Posts: 16

Re: gravity fall

sonicfan12p wrote:

There are many ways to do it, but I've never found a perfect one, so wasabi's script will definitely work. Besides, your script may have worked, but there is no way to come down, only up.

big_smile  okay, thanks!


http://scratch.mit.edu/static/projects/8Bits/2567025_sm.png
The Jungle Game!      "...the graphics...they are amazing" SlipGrippz                            "Yea, its really good." WilliamEPJ                                                                                 36 views, 3 love-its, and 12 downloads

Offline

 

Board footer