Add Skybox and Gravity

master
Mrchiantos 2019-08-01 16:33:50 +02:00
parent da8cbc74b0
commit 33c7c028ff
22 changed files with 152 additions and 0 deletions

View 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
games/earth/menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
games/earth/menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
games/mars/menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
games/mars/menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
games/moon/menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
games/moon/menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB