celestia/scripts/tour-system.celx

26 lines
499 B
Plaintext
Raw Normal View History

2018-05-08 09:51:06 -06:00
-- Title: Tour around Solar system objects
function gotoobject(o, t)
2003-05-01 11:43:42 -06:00
local obs = celestia:getobserver()
obs:follow(o)
obs:gotoobject(o, t)
2003-05-01 11:43:42 -06:00
while (obs:travelling()) do
wait(0)
end
end
function visit(o)
local i, v
celestia:select(o)
celestia:flash(o:type() .. " - " .. o:name())
gotoobject(o, 3)
2003-05-01 11:43:42 -06:00
wait(0.5)
local children = o:getchildren()
2003-05-01 11:43:42 -06:00
for i, v in ipairs(children) do
visit(v)
end
end
sol = celestia:find("Sol")
visit(sol)