From 3ab8a0c3f3163ecdcafe8f1f6d2d0e125edcde86 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Fri, 23 Oct 2015 13:54:37 -0700 Subject: changed color of hud new texture for power pellet renamed craftitems.lua to fruit.lua changed portal to a yellow color --- blocks.lua | 2 +- fruit.lua | 97 ++++++++++++++++++++++++++++++++++++++ hud.lua | 2 +- init.lua | 4 +- portals.lua | 6 ++- textures/mypacman_portal.png | Bin 450 -> 144 bytes textures/mypacman_powerpellet.png | Bin 0 -> 238 bytes 7 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 fruit.lua create mode 100644 textures/mypacman_powerpellet.png diff --git a/blocks.lua b/blocks.lua index 93fbfe5..3f6b223 100644 --- a/blocks.lua +++ b/blocks.lua @@ -1,7 +1,7 @@ local sbox = { type = "fixed", fixed = { - {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + {-0.45, -0.45, -0.45, 0.45, 0.45, 0.45} } } local cbox = { diff --git a/fruit.lua b/fruit.lua new file mode 100644 index 0000000..8648363 --- /dev/null +++ b/fruit.lua @@ -0,0 +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",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][2] + local hlth = pelletitems[i][3] + local cbox = pelletitems[i][4] + +minetest.register_node("mypacman:"..itm,{ + description = desc, + inventory_image = "mypacman_"..itm..".png", + 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 diff --git a/hud.lua b/hud.lua index 791e422..d1f2b34 100755 --- a/hud.lua +++ b/hud.lua @@ -23,7 +23,7 @@ function mypacman.update_hud(id, player) position = {x = 0, y = 1}, offset = {x=100, y = -100}, scale = {x = 100, y = 100}, - number = 0x8888FF, --color + number = 0xfff227, --color text = hudtext }) hud_table[game.player_name] = hud diff --git a/init.lua b/init.lua index 69c0df7..b6a6e99 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ mypacman = {} -dofile(minetest.get_modpath("mypacman").."/craftitems.lua") +dofile(minetest.get_modpath("mypacman").."/fruit.lua") dofile(minetest.get_modpath("mypacman").."/ghost.lua") dofile(minetest.get_modpath("mypacman").."/blocks.lua") dofile(minetest.get_modpath("mypacman").."/portals.lua") @@ -43,7 +43,7 @@ minetest.register_node("mypacman:pellet_1", { --Power Pellets. Need to make these do something minetest.register_node("mypacman:pellet_2", { description = "Pellet 2", - tiles = {"wool_yellow.png^[colorize:white:140"}, + tiles = {{name="mypacman_powerpellet.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.8}},}, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/portals.lua b/portals.lua index cccd920..cf90712 100644 --- a/portals.lua +++ b/portals.lua @@ -14,11 +14,12 @@ local cbox = { --Portals minetest.register_node("mypacman:portalr", { description = "Portalr ", - drawtype = "allfaces", + drawtype = "glasslike", tiles = {"mypacman_portal.png"}, paramtype = "light", sunlight_propagates = true, light_source = 14, + alpha = 150, paramtype2 = "facedir", walkable = false, is_ground_content = false, @@ -28,11 +29,12 @@ minetest.register_node("mypacman:portalr", { }) minetest.register_node("mypacman:portall", { description = "Portall ", - drawtype = "allfaces", + drawtype = "glasslike", tiles = {"mypacman_portal.png"}, paramtype = "light", sunlight_propagates = true, light_source = 14, + alpha = 150, paramtype2 = "facedir", walkable = false, is_ground_content = false, diff --git a/textures/mypacman_portal.png b/textures/mypacman_portal.png index f351ff5..e491268 100644 Binary files a/textures/mypacman_portal.png and b/textures/mypacman_portal.png differ diff --git a/textures/mypacman_powerpellet.png b/textures/mypacman_powerpellet.png new file mode 100644 index 0000000..880b628 Binary files /dev/null and b/textures/mypacman_powerpellet.png differ -- cgit v1.2.3