summaryrefslogtreecommitdiff
path: root/mario/gamestate.lua
diff options
context:
space:
mode:
authorFernando Carmona Varo <ferkiwi@gmail.com>2015-11-07 09:57:35 +0100
committerFernando Carmona Varo <ferkiwi@gmail.com>2015-11-07 09:57:35 +0100
commit234cac868e1baf2089ef255d0751a7e288725db5 (patch)
treec1e5fda83009858772e62a3569123384ae58c729 /mario/gamestate.lua
parent6b5cbd4939b4f461e89f2c2ce79640aeae72a0c7 (diff)
Improved portal detection, using the already existing collision detection logic instead of abms
Diffstat (limited to 'mario/gamestate.lua')
-rwxr-xr-xmario/gamestate.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/mario/gamestate.lua b/mario/gamestate.lua
index 2572a99..1ccf4a7 100755
--- a/mario/gamestate.lua
+++ b/mario/gamestate.lua
@@ -268,6 +268,12 @@ local function on_player_gamestep(player, gameid)
elseif node.name == "mario:mushroom" then
minetest.remove_node(pos)
mario.on_player_got_mushroom(player, 15)
+ elseif node.name == "mario:portal_right" then
+ player_pos.x = player_pos.x -31
+ player:setpos(player_pos)
+ elseif node.name == "mario:portal_left" then
+ player_pos.x = player_pos.x +31
+ player:setpos(player_pos)
end
end
end