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

#1 2008-11-08 20:10:35

AllScratchedUp
Scratcher
Registered: 2008-01-20
Posts: 47

Gravity to a point

Does anybody know a simple way to make a program that makes a sprite attracted (i.e. gravity) to another sprite, like Seancanoodle's Little Planet?

Please help!!  smile


"Sometimes I lie awake at night, and I ask, "Where have I gone wrong?" Then a voice says to me, "This is going to take more than one night.""-Charles Schultz
http://smileyjungle.com/smilies/violent23.gif http://smileyjungle.com/smilies/celebrate3.gif

Offline

 

#2 2008-11-08 22:05:45

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Gravity to a point

AllScratchedUp wrote:

Does anybody know a simple way to make a program that makes a sprite attracted (i.e. gravity) to another sprite, like Seancanoodle's Little Planet?

Please help!!  smile

How about something like this?

[blocks]
<when green flag clicked>
<forever if><<  <not>  <touching[ Planet Sprite >>
<point towards( Planet Sprite
<move( 2 )steps>
<end>
[/blocks]

And if you don't want the sprite changing angle, you could use a hidden sprite to do the gravity part and have the falling sprite just positioning itself on the hidden sprite.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-11-09 16:54:01

AllScratchedUp
Scratcher
Registered: 2008-01-20
Posts: 47

Re: Gravity to a point

Thanks!  smile  There is one problem, though: ther's no way to rotate around the planet!


"Sometimes I lie awake at night, and I ask, "Where have I gone wrong?" Then a voice says to me, "This is going to take more than one night.""-Charles Schultz
http://smileyjungle.com/smilies/violent23.gif http://smileyjungle.com/smilies/celebrate3.gif

Offline

 

Board footer