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

#1 2012-06-16 12:15:43

william465
Scratcher
Registered: 2012-04-20
Posts: 47

problems with staying on platforms

hey i need help whenever i make a platform my sprite will walk on it but when i put one in mid air and make my sprite jump on it it will but when i walk off the platform instead of falling off it walks in mid air!


http://i46.tinypic.com/w1qmxf.png

Offline

 

#2 2012-06-16 13:12:37

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

Re: problems with staying on platforms

What you need is gravity:

when gf clicked
forever//this whole script will go to the jumping sprite
if <touching color[color of platform]?>
change y by(5)
end
if <not<touching color[color of platform]?>>
change y by (-5)
end
Hopefully this helps  smile


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

Offline

 

#3 2012-06-19 10:41:23

william465
Scratcher
Registered: 2012-04-20
Posts: 47

Re: problems with staying on platforms

thanks!


http://i46.tinypic.com/w1qmxf.png

Offline

 

#4 2012-06-19 11:11:13

zhukev
Scratcher
Registered: 2012-05-12
Posts: 2

Re: problems with staying on platforms

cool

Offline

 

#5 2012-06-19 11:25:33

william465
Scratcher
Registered: 2012-04-20
Posts: 47

Re: problems with staying on platforms

uh how did you get here


http://i46.tinypic.com/w1qmxf.png

Offline

 

#6 2012-06-19 12:09:44

william465
Scratcher
Registered: 2012-04-20
Posts: 47

Re: problems with staying on platforms

hey wasabi it worked!


http://i46.tinypic.com/w1qmxf.png

Offline

 

#7 2012-06-20 10:39:56

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: problems with staying on platforms

Try putting this in your gravity:

forever
  if <touching color [color of platform]>
    set [Gravity v] to [0]
  else
    change [Gravity v] by [a negative number]
  end
  change y by [1]
  change y by (Gravity)
end

Offline

 

#8 2012-07-08 09:55:29

william465
Scratcher
Registered: 2012-04-20
Posts: 47

Re: problems with staying on platforms

guys you can stop posting wasabi gave me my answer


http://i46.tinypic.com/w1qmxf.png

Offline

 

#9 2012-07-08 14:24:04

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: problems with staying on platforms

I've closed the thread to stop people from continuing to post - since william465 seems to have had his question answered. If you want the thread re-opened, willaim,  you can use the report button in the bottom-right of posts to get our attention - same with wanting a thread like this closed!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

Board footer