Add Skybox and Gravity
51
games/earth/files/World/skybox/init.lua
Normal file
@ -0,0 +1,51 @@
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
--Version 0.2
|
||||
|
||||
pos = {x=0, y=0, z=0}
|
||||
|
||||
--The skybox for space, feel free to change it to however you like.
|
||||
|
||||
local skybox = {
|
||||
"sky.png",
|
||||
"sky.png",
|
||||
"sky_1.png",
|
||||
"sky.png",
|
||||
"sky.png",
|
||||
"sky.png",
|
||||
}
|
||||
|
||||
|
||||
local time = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
if time > 1 then for _, player in ipairs(minetest.get_connected_players()) do
|
||||
time = 0
|
||||
|
||||
local name = player:get_player_name()
|
||||
local pos = player:getpos()
|
||||
|
||||
-- 9,807 m/s²
|
||||
|
||||
player:set_physics_override(1, 1, 1) -- speed, jump, gravity [default]
|
||||
player:set_sky({}, "skybox", skybox) -- Sets skybox, in this case it sets the skybox to it's default setting if and only if the player's Y value is less than the value of space.
|
||||
|
||||
end end end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name then
|
||||
player:set_sky({}, "skybox", skybox)
|
||||
|
||||
end end)
|
BIN
games/earth/files/World/skybox/textures/sky.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
games/earth/files/World/skybox/textures/sky_1.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
games/earth/files/World/skybox/textures/space.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
games/earth/files/World/skybox/textures/space_1.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
games/earth/menu/header.png
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
games/earth/menu/icon.png
Normal file
After Width: | Height: | Size: 14 KiB |
50
games/mars/files/World/skybox/init.lua
Normal file
@ -0,0 +1,50 @@
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
--Version 0.2
|
||||
|
||||
pos = {x=0, y=0, z=0}
|
||||
|
||||
--The skybox for space, feel free to change it to however you like.
|
||||
|
||||
local skybox = {
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
}
|
||||
|
||||
local time = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
if time > 1 then for _, player in ipairs(minetest.get_connected_players()) do
|
||||
time = 0
|
||||
|
||||
local name = player:get_player_name()
|
||||
local pos = player:getpos()
|
||||
|
||||
-- 3,711 m/s²
|
||||
|
||||
player:set_physics_override(1, 1, 0.3784031814) -- speed, jump, gravity [default]
|
||||
player:set_sky({}, "skybox", skybox) -- Sets skybox, in this case it sets the skybox to it's default setting if and only if the player's Y value is less than the value of space.
|
||||
|
||||
end end end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name then
|
||||
player:set_sky({}, "skybox", skybox)
|
||||
|
||||
end end)
|
BIN
games/mars/files/World/skybox/textures/sky.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
games/mars/files/World/skybox/textures/sky_1.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
games/mars/files/World/skybox/textures/space.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
games/mars/files/World/skybox/textures/space_1.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
games/mars/menu/header.png
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
games/mars/menu/icon.png
Normal file
After Width: | Height: | Size: 12 KiB |
51
games/moon/files/World/skybox/init.lua
Normal file
@ -0,0 +1,51 @@
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function(player)
|
||||
minetest.setting_set("time_speed", 0)
|
||||
minetest.setting_set("time", 12000)
|
||||
end)
|
||||
|
||||
--Version 0.2
|
||||
|
||||
pos = {x=0, y=0, z=0}
|
||||
|
||||
--The skybox for space, feel free to change it to however you like.
|
||||
|
||||
local skybox = {
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space_1.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
"space.png",
|
||||
}
|
||||
|
||||
|
||||
local time = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
if time > 1 then for _, player in ipairs(minetest.get_connected_players()) do
|
||||
time = 0
|
||||
|
||||
local name = player:get_player_name()
|
||||
local pos = player:getpos()
|
||||
|
||||
-- 1,620 m/s²
|
||||
|
||||
player:set_physics_override(1, 1, 0.16518813092) -- speed, jump, gravity [default]
|
||||
player:set_sky({}, "skybox", skybox) -- Sets skybox, in this case it sets the skybox to it's default setting if and only if the player's Y value is less than the value of space.
|
||||
|
||||
end end end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name then
|
||||
player:set_sky({}, "skybox", skybox)
|
||||
|
||||
end end)
|
BIN
games/moon/files/World/skybox/textures/sky.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
games/moon/files/World/skybox/textures/sky_1.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
games/moon/files/World/skybox/textures/space.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
games/moon/files/World/skybox/textures/space_1.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
games/moon/files/World/skybox/textures/space_2.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
games/moon/menu/header.png
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
games/moon/menu/icon.png
Normal file
After Width: | Height: | Size: 9.8 KiB |