Pages: 1
Topic closed
Last year I worked with a Year 5 (Age 9-10) class to produce sun/earth/moon simulations.
http://scratch.mit.edu/users/euxtonscratch
But one problem that I had trouble with was getting the earth to move around the sun (or the moon around the earth) in a true circle without changing the direction of the orbiting sprite
So everyone managed to move the earth from 120,0 to 0,120 to -120,0 to 0,-120 and back to 120,0. (and some did 120,0 80,80 0,120, -80,80 as an rough approximation of the intermediate values
But it would have been nice to be able to come up with something that could do a effective curved glide between the points rather than discrete jumps.
Obviously sin/cos solutions are not really approriate for this age group
Any clever ideas?
regards
Simon
Last edited by SimpleScratch (2011-06-25 18:09:07)
Offline
You can take a look at this project.
Put its script in the Earth sprite and change the "mouse x/y" pieces to "x/y position of sun" pieces.
EDIT: Oh, sorry, you didn't want trigonometry. Give me a second to get a simpler version.
Try putting this in your Earth sprite. Yes it does use direction, but you can't see the directional change (at least not in presentation mode and not when shared to the site), and I can't think of any other way that doesn't use trig.
You can edit the "point in direction 90" to change the direction you will see the sprite facing when it's orbiting.
Last edited by Kileymeister (2011-06-25 21:52:31)
Offline
As an alternative to Kileymeister's script, you could set the center of the sprite to a point where the planet it will be orbiting will be, then simply use a [Go to sprite] block and rotate the sprite. This also uses rotation of the sprite itself, but it's simple. I'm afraid you probably won't find a method that uses neither rotation nor trigonometry.
Offline
If you just want a very simple one try:
/When green flag clicked\
[Forever]
[] [Point towards [Earth]]
[] [Turn (90) Degrees]
[] [Move (5) steps]
[____________]
Offline
Building on Harakou's idea; Use a "guide" sprite to move the planet.
In the guide sprite;
Go to (Sun)
Rotate (desired angle step)
Move (desired radius)
Broadcast "Update Planet" and wait
In the Planet sprite;
When I Receive (Update Planet)
Go to (guide)
You could begin with the guide sprite visible (and in front of everything else) so that students can see what is going on (you could also have the planet "wait 0.5" after moving if desired). After it's clear how the program works, hide the guide sprite.
This could be expanded to handle more planets, after the first planet, have the guide repeat its move with a different rotation angle and radius, the broadcast "Update Planet 2" and wait.
I've used the guide sprite idea to move a "spaceship", where the direction you are pointing and the direction of travel have to be maintained separately. These project do use Sin and Cos; Trig sure makes it easier...
Offline
@ednaC - I came up with this code after Killymeister's script and Harakou's idea
http://scratch.mit.edu/projects/SimpleScratch/1886216
and talking with the class teacher, we decided the same as you - show the guide sprite (I like the term BTW) working first and then hide it for production
Who needs trig or variables when you've got great objects and methods
Simon
Offline
The moon phases idea is a nice project. Another idea comes to mind, especially if you intend to do a smooth orbit; You could replace the pictures of phases with a picture of the moon and slide a "mask" sprite over it in time with the orbit motion. The mask would just be a black sprite with the right shape, "on top of" the moon picture.
Offline
Topic closed
Pages: 1