diff options
author | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-11-07 10:27:05 +0100 |
---|---|---|
committer | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-11-07 10:27:05 +0100 |
commit | aeaca5d7494efe55767c997181a5c071c4800c43 (patch) | |
tree | 8ea473837f6efed03c5c5ec63639b0e3042272fe /mario/blocks.lua | |
parent | 234cac868e1baf2089ef255d0751a7e288725db5 (diff) |
Some refactoring for the on_player_collision
Diffstat (limited to 'mario/blocks.lua')
-rw-r--r-- | mario/blocks.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mario/blocks.lua b/mario/blocks.lua index f44f61f..4c493d4 100644 --- a/mario/blocks.lua +++ b/mario/blocks.lua @@ -52,6 +52,10 @@ minetest.register_node("mario:coin", { on_destruct = function(pos) minetest.sound_play("mario-coin", {pos = pos,max_hear_distance = 40,gain = 10.0,}) end, + on_player_collision = function(pos, player, gameid) + minetest.remove_node(pos) + mario.on_player_got_coin(player) + end }) local nbox = { @@ -86,6 +90,10 @@ minetest.register_node("mario:mushroom",{ on_destruct = function(pos) minetest.sound_play("mario-bonus", {pos = pos,max_hear_distance = 40,gain = 10.0,}) end, + on_player_collision = function(pos, player, gameid) + minetest.remove_node(pos) + mario.on_player_got_mushroom(player, 15) + end }) minetest.register_node("mario:mushroom_green",{ @@ -106,4 +114,8 @@ minetest.register_node("mario:mushroom_green",{ on_destruct = function(pos) minetest.sound_play("mario-1-up", {pos = pos,max_hear_distance = 40,gain = 10.0,}) end, + on_player_collision = function(pos, player, gameid) + minetest.remove_node(pos) + mario.on_player_got_mushroom(player, 15) + end }) |