diff --git a/init.lua b/init.lua index 4feca90..f5be5bf 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,6 @@ local modname = "balloon_bop" balloon_bop = {} -balloon_bop.physical = {} -balloon_bop.collisionbox = {} local round_time_default = 20 @@ -36,14 +34,12 @@ arena_lib.register_minigame( modname , { }, - -- The prefix (string) is what's going to appear in most of the lines printed by your mod. - -- Default is [Arena_lib] + -- The prefix (string) is what's going to appear in most of the lines printed by your mod. Default is [Arena_lib] prefix = "["..modname.."] ", - time_mode = 'incremental', -- for our sample minigame, we will use incrementing time. - -- This will allow us to use on_time_tick if we want to. + time_mode = 'incremental', -- for our sample minigame, we will use incrementing time. This will allow us to use on_time_tick if we want to. hotbar = { diff --git a/items.lua b/items.lua index 50fc335..c2c9f7e 100644 --- a/items.lua +++ b/items.lua @@ -154,7 +154,7 @@ local balloon = { --todo: add pop sound return end - if moveresult.touching_ground then + if moveresult.touching_ground and not(moveresult.standing_on_object) then self._touching_ground = true else --slow our x,z velocities diff --git a/minigame_manager/on_start.lua b/minigame_manager/on_start.lua index e795639..dc9455e 100644 --- a/minigame_manager/on_start.lua +++ b/minigame_manager/on_start.lua @@ -7,7 +7,6 @@ -- replace "sample_minigame" with the mod name here balloon_bop.infohuds = {} - arena_lib.on_start("balloon_bop", function(arena) for pl_name,stats in pairs(arena.players) do -- it is a good convention to use "pl_name" in for loops and "p_name" elsewhere @@ -23,12 +22,6 @@ arena_lib.on_start("balloon_bop", function(arena) scale = {x = 100, y = 100}, -- covered later size = {x = 2 }, }) - balloon_bop.physical[pl_name] = player:get_properties().physical - balloon_bop.collisionbox[pl_name] = player:get_properties().collisionbox - player:set_properties({ - physical=false, - collisionbox={-.5,0,-.5,.5,0.001,0.5} - }) end end -- arena.current_round_time = arena.round_time @@ -59,12 +52,6 @@ arena_lib.on_join("balloon_bop", function(p_name, arena, as_spectator) scale = {x = 100, y = 100}, -- covered later size = {x = 2 }, }) - balloon_bop.physical[p_name] = player:get_properties().physical - balloon_bop.collisionbox[p_name] = player:get_properties().collisionbox - player:set_properties({ - physical=false, - collisionbox={-.5,0,-.5,.5,0.001,0.5} - }) end end end) \ No newline at end of file diff --git a/minigame_manager/on_time_tick.lua b/minigame_manager/on_time_tick.lua index bfc9703..798dbd5 100644 --- a/minigame_manager/on_time_tick.lua +++ b/minigame_manager/on_time_tick.lua @@ -49,10 +49,6 @@ arena_lib.on_time_tick("balloon_bop", function(arena) if player then player:hud_remove(balloon_bop.infohuds[pl_name]) balloon_bop.infohuds[pl_name] = nil - player:set_properties({ - physical = balloon_bop.physical[pl_name] or true, - collisionbox = balloon_bop.collisionbox[pl_name] or {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5}, - }) end end minetest.chat_send_player(pl_name,"Game Over! Your score is ".. arena.score .."!") @@ -77,11 +73,7 @@ end) arena_lib.on_quit("balloon_bop", function(arena, p_name, is_spectator) player = minetest.get_player_by_name(p_name) if player then - player:hud_remove(balloon_bop.infohuds[p_name]) + player:hud_remove(balloon_bop.infohuds[pl_name]) balloon_bop.infohuds[p_name] = nil - player:set_properties({ - physical = balloon_bop.physical[pl_name] or true, - collisionbox = balloon_bop.collisionbox[p_name] - }) end end) \ No newline at end of file