diff options
author | DonBatman <serfdon@gmail.com> | 2015-10-22 09:25:40 -0700 |
---|---|---|
committer | DonBatman <serfdon@gmail.com> | 2015-10-22 09:25:40 -0700 |
commit | f8e75176876652333b376398d982ad06ac26b66f (patch) | |
tree | 5dc85a8e0640c685507e7ff761a5132029f1c2d9 /craftitems.lua | |
parent | 834797777bbd6c2510742885a192987fdbfb3d79 (diff) |
Added score to table. Changed craft items to nodes. Changed sounds. Changed blocks to immortal
Diffstat (limited to 'craftitems.lua')
-rw-r--r-- | craftitems.lua | 98 |
1 files changed, 88 insertions, 10 deletions
diff --git a/craftitems.lua b/craftitems.lua index 34948d8..8648363 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -1,19 +1,97 @@ +local cherry_box = { + type = "fixed", + fixed = { + {0, -0.375, -0.0625, 0.25, 0, 0.0625}, + {-0.0625, -0.3125, -0.0625, 0.3125, -0.0625, 0.0625}, + {-0.3125, -0.25, -0.0625, -0.125, 0.125, 0.0625}, + {-0.375, -0.1875, -0.0625, -0.125, 0.0625, 0.0625}, + {-0.125, -0.0625, -0.0625, -0.0625, 0.125, 0.0625}, + {-0.0625, 0, -0.0625, 0, 0.0625, 0.0625}, + {-0.0625, 0.125, -0.0625, 0, 0.1875, 0.0625}, + {0, 0.1875, -0.0625, 0.125, 0.25, 0.0625}, + {0.125, 0.25, -0.0625, 0.375, 0.3125, 0.0625}, + {0.25, 0.3125, -0.0625, 0.375, 0.375, 0.0625}, + {0.1875, 0.125, -0.0625, 0.25, 0.25, 0.0625}, + {0.125, 0.0625, -0.0625, 0.1875, 0.125, 0.0625}, + {0.0625, 0, -0.0625, 0.125, 0.0625, 0.0625}, + } + } +local strawberry_box = { + type = "fixed", + fixed = { + {-0.0625, 0.3125, -0.0625, 0, 0.375, 0.0625}, + {-0.25, 0.25, -0.0625, 0.1875, 0.3125, 0.0625}, + {-0.3125, 0.1875, -0.0625, 0.25, 0.25, 0.0625}, + {-0.375, -0.0625, -0.0625, 0.3125, 0.1875, 0.0625}, + {-0.3125, -0.1875, -0.0625, 0.25, -0.0625, 0.0625}, + {-0.25, -0.25, -0.0625, 0.1875, -0.1875, 0.0625}, + {-0.1875, -0.3125, -0.0625, 0.125, -0.25, 0.0625}, + {-0.0625, -0.375, -0.0625, 0, -0.3125, 0.0625}, + } + } +local apple_box = { + type = "fixed", + fixed = { + {-0.3125, -0.125, -0.0625, 0.375, 0.25, 0.0625}, + {-0.375, -0.125, -0.0625, -0.3125, 0.1875, 0.0625}, + {-0.3125, -0.25, -0.0625, 0.3125, -0.125, 0.0625}, + {-0.25, -0.3125, -0.0625, 0.25, -0.25, 0.0625}, + {0.0625, -0.375, -0.0625, 0.1875, -0.3125, 0.0625}, + {-0.1875, -0.375, -0.0625, 0, -0.3125, 0.0625}, + {0.125, 0.25, -0.0625, 0.3125, 0.3125, 0.0625}, + {0, 0.25, -0.0625, 0.0625, 0.3125, 0.0625}, + {-0.25, 0.25, -0.0625, -0.0625, 0.3125, 0.0625}, + {-0.0625, 0.3125, -0.0625, 0, 0.375, 0.0625}, + } + } +local orange_box = { + type = "fixed", + fixed = { + {-0.375, -0.125, -0.0625, 0.375, 0.125, 0.0625}, + {-0.3125, -0.25, -0.0625, 0.3125, 0.1875, 0.0625}, + {-0.25, -0.3125, -0.0625, 0.25, 0.25, 0.0625}, + {0.0625, -0.375, -0.0625, 0.1875, -0.3125, 0.0625}, + {-0.1875, -0.375, -0.0625, 0, -0.3125, 0.0625}, + {0, 0.25, -0.0625, 0.0625, 0.375, 0.0625}, + {-0.25, 0.3125, -0.0625, 0.0625, 0.375, 0.0625}, + {-0.1875, 0.25, -0.0625, -0.0625, 0.4375, 0.0625}, + {-0.25, 0.25, -0.0625, -0.1875, 0.3125, 0.0625}, + } + } + local pelletitems = { - {"cherrys", "Cherrys","2"}, - {"apple", "Apple","3"}, - {"peach", "Peach","4"}, - {"strawberry", "Strawberry","2"}, + {"cherrys", "Cherrys","2",cherry_box}, + {"apple", "Apple","3",apple_box}, + {"orange", "Orange","4",orange_box}, + {"strawberry", "Strawberry","2",strawberry_box}, } for i in ipairs (pelletitems) do local itm = pelletitems[i][1] - local desc = pelletitems[i][1] - local hlth = pelletitems[i][1] - + local desc = pelletitems[i][2] + local hlth = pelletitems[i][3] + local cbox = pelletitems[i][4] -minetest.register_craftitem("mypacman:"..itm,{ +minetest.register_node("mypacman:"..itm,{ description = desc, inventory_image = "mypacman_"..itm..".png", - on_use = minetest.item_eat(2), - groups = {not_in_creative_inventory = 1}, + tiles = { + "mypacman_"..itm..".png", + "mypacman_"..itm..".png", + "mypacman_"..itm..".png", + "mypacman_"..itm..".png", + "mypacman_"..itm..".png", + "mypacman_"..itm..".png^[transformFX", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + light_source = 14, + groups = {cracky=3,not_in_creative_inventory = 0}, + node_box = cbox, + collision_box = cbox, + after_destruct = function(pos, oldnode) + mypacman.on_player_got_fruit() + end, }) end |