Make games on your phone.
Get the app!
AndroidiOS
Castle
@DaltonJos

Sistema solar

Game by @DaltonJos
play65
2
3 Comments
Next up
Sistema solar #sistemasolar #espaco
More from @DaltonJos ↓
In real life ,the solar system doesn’t move like this .
Reply
This is the script, local sunX = 0 local sunY = 0 local radius = 0 local speed = 3.46 local startAngle = 0 local startTime = 0 function onCreate() local dx = my.layout.x - sunX local dy = my.layout.y - sunY radius = math.sqrt(dx * dx + dy * dy) startAngle = math.atan2(dy, dx) startTime = castle.getTime() end function onUpdate(dt) local elapsed = castle.getTime() - startTime local angle = startAngle + elapsed * speed my.layout.x = sunX + radius * math.cos(angle) my.layout.y = sunY + radius * math.sin(angle) end function onMessage(message, triggeringActor) end
Reply
the solar system moves and you did not notice
Reply

More from @DaltonJos

See all from @DaltonJos →