@athros woah, sounds pretty awesome! You should keep me updated
@Monkeyman32123 There isnāt anything wrong with yours. I was just pointing out that there were other orbit programs on the forum. No matter how much I know, if I look at someone elseās code, I always learn something new.
I guess there are as many ways to orbit a planet as there are planets.
Here is another version using Codea rotate and translate. In this way you can rotate a moon with a moon around a planet. I leave it as a challenge to modify it so that the moons dont collide.
function setup()
displayMode(FULLSCREEN)
end
function draw()
background(40, 40, 50)
translate(CurrentTouch.x, CurrentTouch.y)
math.randomseed(1)
for i = 1,10 do
rotate(math.random(0,360) + -- start angle
math.random(30,90)*ElapsedTime) -- rotation speed
sprite("SpaceCute:Planet",0,0,100)
translate(200,0) -- distance to planet
scale(.6) -- size of moon
end
end
@dave1707 If every time you look at someoneās code you learn something new, then when are you going to learn about local?
@SkyTheCoder I know about locals and what itās used for. I just donāt need it in the code I write. Someone else might need locals if they take my code and try to use it in their code. Then theyāll need to learn about locals.