enviro: getting punched by player restores 50% of gravity
parent
d49f6ad867
commit
f028f7d91d
1
ball.lua
1
ball.lua
|
@ -609,7 +609,6 @@ minetest.register_tool("basic_machines:ball_spell", {
|
|||
|
||||
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "basic_machines:ball_spawner",
|
||||
recipe = {
|
||||
|
|
12
enviro.lua
12
enviro.lua
|
@ -286,6 +286,18 @@ end)
|
|||
-- end
|
||||
-- });
|
||||
|
||||
|
||||
minetest.register_on_punchplayer( -- bring gravity closer to normal with each punch
|
||||
function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
|
||||
|
||||
local gravity = player:get_physics_override().gravity;
|
||||
if gravity<1 then
|
||||
gravity = 0.5*gravity+0.5;
|
||||
player:set_physics_override({gravity=gravity})
|
||||
end
|
||||
end
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue