From 6a55251a4526095fb691f5fca0a9d51c0d1cf7c0 Mon Sep 17 00:00:00 2001 From: Fernando Carmona Varo Date: Sat, 24 Oct 2015 01:19:24 +0200 Subject: Moved and renamed to pacmine --- blocks.lua | 75 -------- craftitems.lua | 97 ----------- gamestate.lua | 296 -------------------------------- ghost.lua | 147 ---------------- hud.lua | 43 ----- init.lua | 99 ----------- modpack.txt | 0 pacmine/blocks.lua | 76 ++++++++ pacmine/craftitems.lua | 97 +++++++++++ pacmine/gamestate.lua | 296 ++++++++++++++++++++++++++++++++ pacmine/ghost.lua | 147 ++++++++++++++++ pacmine/hud.lua | 43 +++++ pacmine/init.lua | 102 +++++++++++ pacmine/portals.lua | 73 ++++++++ pacmine/schems/pacmine_3.mts | Bin 0 -> 1156 bytes pacmine/sounds/pacmine_beginning.ogg | Bin 0 -> 17153 bytes pacmine/sounds/pacmine_chomp.ogg | Bin 0 -> 7014 bytes pacmine/sounds/pacmine_death.ogg | Bin 0 -> 7619 bytes pacmine/sounds/pacmine_eatfruit.ogg | Bin 0 -> 4343 bytes pacmine/sounds/pacmine_eatghost.ogg | Bin 0 -> 4687 bytes pacmine/sounds/pacmine_extrapac.ogg | Bin 0 -> 7594 bytes pacmine/sounds/pacmine_powerup.ogg | Bin 0 -> 20591 bytes pacmine/textures/pacmine_1.png | Bin 0 -> 473 bytes pacmine/textures/pacmine_apple.png | Bin 0 -> 313 bytes pacmine/textures/pacmine_blinkyf.png | Bin 0 -> 155 bytes pacmine/textures/pacmine_blinkys.png | Bin 0 -> 126 bytes pacmine/textures/pacmine_cherrys.png | Bin 0 -> 296 bytes pacmine/textures/pacmine_clydef.png | Bin 0 -> 157 bytes pacmine/textures/pacmine_clydes.png | Bin 0 -> 126 bytes pacmine/textures/pacmine_door.png | Bin 0 -> 126 bytes pacmine/textures/pacmine_egg.png | Bin 0 -> 198 bytes pacmine/textures/pacmine_floor.png | Bin 0 -> 556 bytes pacmine/textures/pacmine_glass.png | Bin 0 -> 431 bytes pacmine/textures/pacmine_inkyf.png | Bin 0 -> 158 bytes pacmine/textures/pacmine_inkys.png | Bin 0 -> 126 bytes pacmine/textures/pacmine_inv.png | Bin 0 -> 274 bytes pacmine/textures/pacmine_orange.png | Bin 0 -> 377 bytes pacmine/textures/pacmine_pinkyf.png | Bin 0 -> 158 bytes pacmine/textures/pacmine_pinkys.png | Bin 0 -> 127 bytes pacmine/textures/pacmine_portal.png | Bin 0 -> 450 bytes pacmine/textures/pacmine_strawberry.png | Bin 0 -> 386 bytes pacmine/textures/pacmine_wall.png | Bin 0 -> 498 bytes pacmine/textures/pacmine_wallc.png | Bin 0 -> 500 bytes pacmine/textures/pacmine_walle.png | Bin 0 -> 465 bytes pacmine/textures/pacmine_walls.png | Bin 0 -> 467 bytes portals.lua | 71 -------- schems/mypacman_3.mts | Bin 1156 -> 0 bytes sounds/mypacman_beginning.ogg | Bin 17153 -> 0 bytes sounds/mypacman_chomp.ogg | Bin 7014 -> 0 bytes sounds/mypacman_death.ogg | Bin 7619 -> 0 bytes sounds/mypacman_eatfruit.ogg | Bin 4343 -> 0 bytes sounds/mypacman_eatghost.ogg | Bin 4687 -> 0 bytes sounds/mypacman_extrapac.ogg | Bin 7594 -> 0 bytes sounds/mypacman_powerup.ogg | Bin 20591 -> 0 bytes textures/mypacman_1.png | Bin 473 -> 0 bytes textures/mypacman_apple.png | Bin 313 -> 0 bytes textures/mypacman_blinkyf.png | Bin 155 -> 0 bytes textures/mypacman_blinkys.png | Bin 126 -> 0 bytes textures/mypacman_cherrys.png | Bin 296 -> 0 bytes textures/mypacman_clydef.png | Bin 157 -> 0 bytes textures/mypacman_clydes.png | Bin 126 -> 0 bytes textures/mypacman_door.png | Bin 126 -> 0 bytes textures/mypacman_egg.png | Bin 198 -> 0 bytes textures/mypacman_floor.png | Bin 556 -> 0 bytes textures/mypacman_glass.png | Bin 431 -> 0 bytes textures/mypacman_inkyf.png | Bin 158 -> 0 bytes textures/mypacman_inkys.png | Bin 126 -> 0 bytes textures/mypacman_inv.png | Bin 274 -> 0 bytes textures/mypacman_orange.png | Bin 377 -> 0 bytes textures/mypacman_pinkyf.png | Bin 158 -> 0 bytes textures/mypacman_pinkys.png | Bin 127 -> 0 bytes textures/mypacman_portal.png | Bin 450 -> 0 bytes textures/mypacman_strawberry.png | Bin 386 -> 0 bytes textures/mypacman_wall.png | Bin 498 -> 0 bytes textures/mypacman_wallc.png | Bin 500 -> 0 bytes textures/mypacman_walle.png | Bin 465 -> 0 bytes textures/mypacman_walls.png | Bin 467 -> 0 bytes 77 files changed, 834 insertions(+), 828 deletions(-) delete mode 100644 blocks.lua delete mode 100644 craftitems.lua delete mode 100755 gamestate.lua delete mode 100644 ghost.lua delete mode 100755 hud.lua delete mode 100644 init.lua create mode 100644 modpack.txt create mode 100644 pacmine/blocks.lua create mode 100644 pacmine/craftitems.lua create mode 100755 pacmine/gamestate.lua create mode 100644 pacmine/ghost.lua create mode 100755 pacmine/hud.lua create mode 100644 pacmine/init.lua create mode 100644 pacmine/portals.lua create mode 100644 pacmine/schems/pacmine_3.mts create mode 100644 pacmine/sounds/pacmine_beginning.ogg create mode 100644 pacmine/sounds/pacmine_chomp.ogg create mode 100644 pacmine/sounds/pacmine_death.ogg create mode 100644 pacmine/sounds/pacmine_eatfruit.ogg create mode 100644 pacmine/sounds/pacmine_eatghost.ogg create mode 100644 pacmine/sounds/pacmine_extrapac.ogg create mode 100644 pacmine/sounds/pacmine_powerup.ogg create mode 100644 pacmine/textures/pacmine_1.png create mode 100644 pacmine/textures/pacmine_apple.png create mode 100644 pacmine/textures/pacmine_blinkyf.png create mode 100644 pacmine/textures/pacmine_blinkys.png create mode 100644 pacmine/textures/pacmine_cherrys.png create mode 100644 pacmine/textures/pacmine_clydef.png create mode 100644 pacmine/textures/pacmine_clydes.png create mode 100644 pacmine/textures/pacmine_door.png create mode 100644 pacmine/textures/pacmine_egg.png create mode 100644 pacmine/textures/pacmine_floor.png create mode 100644 pacmine/textures/pacmine_glass.png create mode 100644 pacmine/textures/pacmine_inkyf.png create mode 100644 pacmine/textures/pacmine_inkys.png create mode 100644 pacmine/textures/pacmine_inv.png create mode 100644 pacmine/textures/pacmine_orange.png create mode 100644 pacmine/textures/pacmine_pinkyf.png create mode 100644 pacmine/textures/pacmine_pinkys.png create mode 100644 pacmine/textures/pacmine_portal.png create mode 100644 pacmine/textures/pacmine_strawberry.png create mode 100644 pacmine/textures/pacmine_wall.png create mode 100644 pacmine/textures/pacmine_wallc.png create mode 100644 pacmine/textures/pacmine_walle.png create mode 100644 pacmine/textures/pacmine_walls.png delete mode 100644 portals.lua delete mode 100644 schems/mypacman_3.mts delete mode 100644 sounds/mypacman_beginning.ogg delete mode 100644 sounds/mypacman_chomp.ogg delete mode 100644 sounds/mypacman_death.ogg delete mode 100644 sounds/mypacman_eatfruit.ogg delete mode 100644 sounds/mypacman_eatghost.ogg delete mode 100644 sounds/mypacman_extrapac.ogg delete mode 100644 sounds/mypacman_powerup.ogg delete mode 100644 textures/mypacman_1.png delete mode 100644 textures/mypacman_apple.png delete mode 100644 textures/mypacman_blinkyf.png delete mode 100644 textures/mypacman_blinkys.png delete mode 100644 textures/mypacman_cherrys.png delete mode 100644 textures/mypacman_clydef.png delete mode 100644 textures/mypacman_clydes.png delete mode 100644 textures/mypacman_door.png delete mode 100644 textures/mypacman_egg.png delete mode 100644 textures/mypacman_floor.png delete mode 100644 textures/mypacman_glass.png delete mode 100644 textures/mypacman_inkyf.png delete mode 100644 textures/mypacman_inkys.png delete mode 100644 textures/mypacman_inv.png delete mode 100644 textures/mypacman_orange.png delete mode 100644 textures/mypacman_pinkyf.png delete mode 100644 textures/mypacman_pinkys.png delete mode 100644 textures/mypacman_portal.png delete mode 100644 textures/mypacman_strawberry.png delete mode 100644 textures/mypacman_wall.png delete mode 100644 textures/mypacman_wallc.png delete mode 100644 textures/mypacman_walle.png delete mode 100644 textures/mypacman_walls.png diff --git a/blocks.lua b/blocks.lua deleted file mode 100644 index 93fbfe5..0000000 --- a/blocks.lua +++ /dev/null @@ -1,75 +0,0 @@ -local sbox = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} - } - } -local cbox = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} - } - } -local blocks = { -{"Floor", "floor", "floor","floor",0,true}, -{"Wall", "wall", "wall","floor",11,true}, -{"Wallc", "wallc", "wallc","floor",11,true}, -{"Walle", "walle", "walle","floor",11,true}, -{"Wall Walkthrough","walk_wall","wall","floor",11,false}, -} -for i in ipairs(blocks) do -local des = blocks[i][1] -local itm = blocks[i][2] -local i1 = blocks[i][3] -local i2 = blocks[i][4] -local lit = blocks[i][5] -local tf = blocks[i][6] - -minetest.register_node("mypacman:"..itm, { - description = des, - tiles = { - "mypacman_"..i1..".png", - "mypacman_"..i2..".png", - "mypacman_walls.png", - "mypacman_walls.png", - "mypacman_walls.png", - "mypacman_walls.png", - }, - drawtype = "normal", - paramtype = "light", - paramtype2 = "facedir", - light_source = lit, - walkable = tf, - groups = {disable_jump = 1, immortal=1, not_in_creative_inventory = 1}, - selection_box = sbox, - collision_box = cbox, - -}) -end ---Glass -minetest.register_node("mypacman:glass", { - description = "glass", - tiles = {"mypacman_glass.png"}, - drawtype = "glasslike", - paramtype = "light", - paramtype2 = "facedir", - groups = {immortal=1,not_in_creative_inventory = 1}, - selection_box = cbox, - collision_box = cbox, - -}) -minetest.register_node("mypacman:glassw", { - description = "glassw", - tiles = {"mypacman_glass.png"}, - drawtype = "glasslike", - paramtype = "light", - paramtype2 = "facedir", - walkable = false, - groups = {immortal=1,not_in_creative_inventory = 1}, - selection_box = cbox, - colision_box = cbox, - -}) - - - diff --git a/craftitems.lua b/craftitems.lua deleted file mode 100644 index 8648363..0000000 --- a/craftitems.lua +++ /dev/null @@ -1,97 +0,0 @@ -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/gamestate.lua b/gamestate.lua deleted file mode 100755 index 1cad7f4..0000000 --- a/gamestate.lua +++ /dev/null @@ -1,296 +0,0 @@ - --- Array to hold all the running game states -mypacman.games = {} - --- Store all the currently playing players -mypacman.players = {} - --- Duration of the power pellet effect (in seconds) -local power_pellet_duration = 10 - ---------------------------------------------------------- --- Public functions (these can be called from any other place) - --- Start the game from the spawn block at position "pos" activated by "player" -function mypacman.game_start(pos, player) - -- create an id unique for the given position - local id = minetest.pos_to_string(pos) - - -- make sure any previous game with the same id has ended - if mypacman.games[id] then - mypacman.game_end(id) - end - - -- Create a new game state with that id and add it to the game list - local gamestate = { - id = id, - player_name = player:get_player_name(), - pos = pos, - start = {x=pos.x+14,y=pos.y+0.5,z=pos.z+16}, - pellet_count = 0, - level = 1, - speed = 2, - lives = 3, - score = 0, - } - mypacman.games[id] = gamestate - mypacman.players[id] = player - - minetest.log("action","New pacman game started at " .. id .. " by " .. gamestate.player_name) - - -- place schematic - local schem = minetest.get_modpath("mypacman").."/schems/mypacman_3.mts" - minetest.place_schematic({x=pos.x,y=pos.y-1,z=pos.z-2},schem,0, "air", true) - - -- Set start positions - mypacman.game_reset(id, player) - mypacman.update_hud(id, player) - minetest.sound_play("mypacman_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,}) -end - --- Finish the game with the given id -function mypacman.game_end(id) - mypacman.remove_ghosts(id) - mypacman.remove_hud(mypacman.players[id], mypacman.games[id].player_name) - -- Clear the data - mypacman.games[id] = nil - mypacman.players[id] = nil -end - --- Resets the game to the start positions -function mypacman.game_reset(id, player) - local gamestate = mypacman.games[id] - minetest.log("action", "resetting game " .. id) - - -- Save the time when the game was last resetted (to solve timing issues) - local last_reset = os.time() - - gamestate.power_pellet = false - gamestate.last_reset = last_reset - - -- Position the player - local player = player or minetest.get_player_by_name(gamestate.player_name) - player:setpos(gamestate.start) - - -- Spawn the ghosts and assign the game id to each ghost - minetest.after(2, function() - if mypacman.games[id] and last_reset == mypacman.games[id].last_reset then - local pos = vector.add(gamestate.pos, {x=13,y=0.5,z=19}) - local ghost = minetest.add_entity(pos, "mypacman:inky") - ghost:get_luaentity().gameid = id - end - end) - minetest.after(12, function() - if mypacman.games[id] and last_reset == mypacman.games[id].last_reset then - local pos = vector.add(gamestate.pos, {x=15,y=0.5,z=19}) - local ghost = minetest.add_entity(pos, "mypacman:pinky") - ghost:get_luaentity().gameid = id - end - end) - minetest.after(22, function() - if mypacman.games[id] and last_reset == mypacman.games[id].last_reset then - local pos = vector.add(gamestate.pos, {x=13,y=0.5,z=18}) - local ghost = minetest.add_entity(pos, "mypacman:blinky") - ghost:get_luaentity().gameid = id - end - end) - minetest.after(32, function() - if mypacman.games[id] and last_reset == mypacman.games[id].last_reset then - local pos = vector.add(gamestate.pos, {x=15,y=0.5,z=18}) - local ghost = minetest.add_entity(pos, "mypacman:clyde") - ghost:get_luaentity().gameid = id - end - end) -end - --- Remove all the ghosts from the board with the given id -function mypacman.remove_ghosts(id) - local gamestate = mypacman.games[id] - if not gamestate then return end - - -- Remove all non-players (ghosts!) - local boardcenter = vector.add(gamestate.pos, {x=13,y=0.5,z=15}) - for index, object in ipairs(minetest.get_objects_inside_radius(boardcenter,20)) do - if object:is_player() ~= true then - object:remove() - end - end -end - --- A player got a pellet, update the state -function mypacman.on_player_got_pellet(player) - local name = player:get_player_name() - local gamestate = mypacman.get_game_by_player(name) - if not gamestate then return end - - gamestate.pellet_count = gamestate.pellet_count + 1 - gamestate.score = gamestate.score + 10 - mypacman.update_hud(gamestate.id, player) - - if gamestate.pellet_count >= 252 then -- 252 - minetest.chat_send_player(name, "You cleared the board!") - - mypacman.remove_ghosts(gamestate.id) - gamestate.pellet_count = 0 - gamestate.level = gamestate.level + 1 - gamestate.speed = gamestate.level + 1 - - minetest.after(3.0, function() - minetest.chat_send_player(name, "Starting Level "..gamestate.level) - -- place schematic - local schem = minetest.get_modpath("mypacman").."/schems/mypacman_3.mts" - minetest.place_schematic(vector.add(gamestate.pos, {x=0,y=-1,z=-2}),schem,0, "air", true) - - -- Set start positions - mypacman.game_reset(gamestate.id, player) - minetest.sound_play("mypacman_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,}) - end) - end -end - --- A player got a power pellet, update the state -function mypacman.on_player_got_power_pellet(player) - local name = player:get_player_name() - local gamestate = mypacman.get_game_by_player(name) - if not gamestate then return end - - minetest.chat_send_player(name, "You got a POWER PELLET") - gamestate.power_pellet = os.time() + power_pellet_duration - gamestate.score = gamestate.score + 50 - mypacman.update_hud(gamestate.id, player) - - local boardcenter = vector.add(gamestate.pos, {x=13,y=0.5,z=15}) - local powersound = minetest.sound_play("mypacman_powerup", {pos = boardcenter,max_hear_distance = 20, object=player, loop=true}) - - minetest.after(power_pellet_duration, function() - minetest.sound_stop(powersound) - if os.time() >= (gamestate.power_pellet or 0) then - gamestate.power_pellet = false - minetest.chat_send_player(name, "POWER PELLET wore off") - end - end) -end - --- Get the game that the given player is playing -function mypacman.get_game_by_player(player_name) - for _,gamestate in pairs(mypacman.games) do - if gamestate.player_name == player_name then - return gamestate - end - end -end - ---------------------------------------------------------- ---- Private functions (only can be used inside this file) - --- Save Table -local function gamestate_save() - local data = mypacman.games - local f, err = io.open(minetest.get_worldpath().."/mypacman_data", "w") - if err then return err end - f:write(minetest.serialize(data)) - f:close() -end - ---Read Table -local function gamestate_load() - local f, err = io.open(minetest.get_worldpath().."/mypacman_data", "r") - if f then - local data = minetest.deserialize(f:read("*a")) - f:close() - return data - else - return nil - end -end - --- Called every 0.5 seconds for each player that is currently playing pacman -local function on_player_gamestep(player, gameid) - local player_pos = player:getpos() - local positions = { - {x=0.5,y=0.5,z=0.5}, - {x=-0.5,y=0.5,z=-0.5}, - } - for _,pos in pairs(positions) do - pos = vector.add(player_pos, pos) - local node = minetest.get_node(pos) - if node.name == "mypacman:pellet_1" then - minetest.remove_node(pos) - mypacman.on_player_got_pellet(player) - elseif node.name == "mypacman:pellet_2" then - minetest.remove_node(pos) - mypacman.on_player_got_power_pellet(player) - - minetest.sound_play("mypacman_eatfruit", { - pos = pos, - max_hear_distance = 100, - gain = 10.0, - }) - end - end -end - -------------------- ---- Execution code - --- load the gamestate from disk -mypacman.games = gamestate_load() or {} - --- Time counters -local tmr_gamestep = 0 -local tmr_savestep = 0 -minetest.register_globalstep(function(dtime) - tmr_gamestep = tmr_gamestep + dtime; - if tmr_gamestep > 0.2 then - for id,player in pairs(mypacman.players) do - on_player_gamestep(player, id) - end - tmr_savestep = tmr_savestep + tmr_gamestep - if tmr_savestep > 10 then - gamestate_save() - tmr_savestep = 0 - end - tmr_gamestep = 0 - end -end) - -minetest.register_on_joinplayer(function(player) - local name = player:get_player_name() - for id,game in pairs(mypacman.games) do - if game.player_name == name then - mypacman.players[id] = player - mypacman.update_hud(id, player) - end - end -end) - -minetest.register_on_leaveplayer(function(player) - local name = player:get_player_name() - for id,game in pairs(mypacman.games) do - if game.player_name == name then - mypacman.players[id] = nil - mypacman.remove_hud(player, name) - end - end -end) - --- Chatcommand to end the game for the current player -minetest.register_chatcommand("mypacman_exit", { - params = "", - description = "Loads and saves all rooms", - func = function(name, param) - local gamestate = mypacman.get_game_by_player(name) - if gamestate then - mypacman.game_end(gamestate.id) - minetest.get_player_by_name(name):moveto(vector.add(gamestate.pos,{x=0.5,y=0.5,z=-1.5})) - minetest.chat_send_player(name, "You are no longer playing pacman") - else - minetest.chat_send_player(name, "You are not currently in a pacman game") - end - end -}) - -minetest.register_on_shutdown(function() - minetest.log("action", "Server shuts down. Saving pacman data") - gamestate_save() -end) diff --git a/ghost.lua b/ghost.lua deleted file mode 100644 index 1c9e47e..0000000 --- a/ghost.lua +++ /dev/null @@ -1,147 +0,0 @@ - -local ghosts_death_delay = 5 - - -local ghosts = { - {"pinky","Pinky"}, - {"inky","Inky"}, - {"blinky","Blinky"}, - {"clyde","Clyde"}, - } -for i in ipairs(ghosts) do - local itm = ghosts[i][1] - local desc = ghosts[i][2] - - minetest.register_entity("mypacman:"..itm, { - hp_max = 1, - physical = true, - collide_with_objects = true, - visual = "cube", - visual_size = {x = 0.6, y = 1}, - textures = { - "mypacman_"..itm.."s.png", - "mypacman_"..itm.."s.png", - "mypacman_"..itm.."s.png", - "mypacman_"..itm.."s.png", - "mypacman_"..itm.."f.png", - "mypacman_"..itm.."s.png", - }, - velocity = {x=math.random(-1,1), y=0, z=math.random(-1,1)}, - collisionbox = {-0.25, -1.0, -0.25, 0.25, 0.48, 0.25}, - is_visible = true, - automatic_rotate = true, - automatic_face_movement_dir = -90, -- set yaw direction in degrees, false to disable - makes_footstep_sound = false, - - set_velocity = function(self, v) - if not v then v = 0 end - local yaw = self.object:getyaw() - self.object:setvelocity({x=math.sin(yaw) * -v, y=self.object:getvelocity().y, z=math.cos(yaw) * v}) - end, - - on_step = function(self, dtime) - -- every 1 second - self.timer = (self.timer or 0) + dtime - if self.timer < 1 then return end - self.timer = 0 - - -- Do we have game state? if not just die - local gamestate = mypacman.games[self.gameid] - if not gamestate then - minetest.log("action", "Removing pacman ghost without game assigned") - self.object:remove() - return - end - -- Make sure we are in the right state by keeping track of the reset time - -- if the reset time changed it's likely the game got resetted while the entity wasn't loaded - if self.last_reset then - if self.last_reset ~= gamestate.last_reset then - minetest.log("action", "Removing pacman ghost remaining after reset ") - self.object:remove() - end - else - self.last_reset = gamestate.last_reset - end - - -- Make sure we have a targetted player - if not self.target then - self.target = minetest.get_player_by_name(gamestate.player_name) - end - local player = self.target - - -- If there's no player just stop - if not player then - self.set_velocity(self, 0) - return - end - - local s = self.object:getpos() -- ghost - local p = player:getpos() -- player - - -- find distance from ghost to player - local distance = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 - if distance < 1.5 then - -- player touches ghost!! - - if gamestate.power_pellet then - -- Player eats ghost! move it to spawn - local ghost_spawn = vector.add(gamestate.pos, {x=13,y=0.5,z=19}) - self.object:setpos(ghost_spawn) - -- set the timer negative so it'll have to wait extra time - self.timer = -ghosts_death_delay - -- play sound and reward player - minetest.sound_play("mypacman_eatghost", {pos = boardcenter,max_hear_distance = 6, object=player, loop=false}) - player:get_inventory():add_item('main', 'mypacman:cherrys') - else - -- Ghost catches the player! - gamestate.lives = gamestate.lives - 1 - if gamestate.lives < 1 then - minetest.chat_send_player(gamestate.player_name,"Game Over") - player:moveto(vector.add(gamestate.pos,{x=0.5,y=0.5,z=-1.5})) - mypacman.game_end(self.gameid) - minetest.sound_play("mypacman_death", {pos = boardcenter,max_hear_distance = 20, object=player, loop=false}) - - elseif gamestate.lives == 1 then - minetest.chat_send_player(gamestate.player_name,"This is your last life") - mypacman.game_reset(self.gameid, player) - else - minetest.chat_send_player(gamestate.player_name,"You have ".. gamestate.lives .." lives left") - mypacman.game_reset(self.gameid, player) - end - end - mypacman.update_hud(self.gameid, player) - - else - local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z} - local yaw = (math.atan(vec.z/vec.x)+math.pi/2) - if p.x > s.x then - yaw = yaw + math.pi - end - -- face player and move backwards/forwards - self.object:setyaw(yaw) - if gamestate.power_pellet then - self.set_velocity(self, -gamestate.speed) --negative velocity - else - self.set_velocity(self, gamestate.speed) - end - end - end, - - -- This function should return the saved state of the entity in a string - get_staticdata = function(self) - return (self.gameid or "") .. ";" .. (self.last_reset or "") - end, - - -- This function should load the saved state of the entity from a string - on_activate = function(self, staticdata) - self.object:set_armor_groups({immortal=1}) - if staticdata and staticdata ~= "" then - local data = string.split(staticdata, ";") - if #data == 2 then - self.gameid = data[1] - self.last_reset = tonumber(data[2]) - end - end - end - }) -end diff --git a/hud.lua b/hud.lua deleted file mode 100755 index 791e422..0000000 --- a/hud.lua +++ /dev/null @@ -1,43 +0,0 @@ - - -local hud_table = {} - -function mypacman.update_hud(id, player) - local game = mypacman.games[id] - player = player or minetest.get_player_by_name(game.player_name) - if not player then - return - elseif not game then - mypacman.remove_hud(player) - return - end - - local hudtext = "Score: " .. game.score - .. "\nLevel: " .. game.level - .. "\nLives: " .. game.lives - - local hud = hud_table[game.player_name] - if not hud then - hud = player:hud_add({ - hud_elem_type = "text", - position = {x = 0, y = 1}, - offset = {x=100, y = -100}, - scale = {x = 100, y = 100}, - number = 0x8888FF, --color - text = hudtext - }) - hud_table[game.player_name] = hud - else - player:hud_change(hud, "text", hudtext) - end -end - - -function mypacman.remove_hud(player, playername) - local name = playername or player:get_player_name() - local hud = hud_table[name] - if hud then - player:hud_remove(hud) - hud_table[name] = nil - end -end diff --git a/init.lua b/init.lua deleted file mode 100644 index 69c0df7..0000000 --- a/init.lua +++ /dev/null @@ -1,99 +0,0 @@ - --- This variable will be exported to other mods when they "depend" on this mod -mypacman = {} - - -dofile(minetest.get_modpath("mypacman").."/craftitems.lua") -dofile(minetest.get_modpath("mypacman").."/ghost.lua") -dofile(minetest.get_modpath("mypacman").."/blocks.lua") -dofile(minetest.get_modpath("mypacman").."/portals.lua") -dofile(minetest.get_modpath("mypacman").."/gamestate.lua") -dofile(minetest.get_modpath("mypacman").."/hud.lua") - - ---Yellow Pellets -minetest.register_node("mypacman:pellet_1", { - description = "Pellet 1", - tiles = {"wool_yellow.png"}, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - walkable = false, - light_source = 11, - drop = "", - groups = {dig_immediate = 3, not_in_creative_inventory = 0}, - node_box = { - type = "fixed", - fixed = { - {-0.625, 0.25, -0.125, -0.375, 0.5, 0.125}, - } - }, - on_destruct = function(pos) - minetest.sound_play("mypacman_chomp", { - pos = pos, - max_hear_distance = 100, - gain = 10.0, - }) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - mypacman.on_player_got_pellet(digger) - end, -}) - ---Power Pellets. Need to make these do something -minetest.register_node("mypacman:pellet_2", { - description = "Pellet 2", - tiles = {"wool_yellow.png^[colorize:white:140"}, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - walkable = false, - light_source = 11, - drop = {max_items = 1,items = { - {items = {"mypacman:cherrys"},rarity = 4,}, - {items = {"mypacman:apple"},rarity = 4,}, - {items = {"mypacman:peach"},rarity = 4,}, - {items = {"mypacman:strawberry"},rarity = 4,},}, - }, - groups = {dig_immediate = 3, not_in_creative_inventory = 0}, - node_box = { - type = "fixed", - fixed = { - {-0.625, -0.125, -0.25, -0.375, 0.125, 0.25}, - {-0.75, -0.125, -0.125, -0.25, 0.125, 0.125}, - {-0.625, -0.25, -0.125, -0.375, 0.25, 0.125}, - {-0.6875, -0.1875, -0.1875, -0.3125, 0.1875, 0.1875}, - } - }, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - mypacman.on_player_got_power_pellet(digger) - - minetest.sound_play("mypacman_eatfruit", { - pos = pos, - max_hear_distance = 100, - gain = 10.0, - }) - end, -}) - ---The placer block -minetest.register_node("mypacman:block2",{ - description = "Pacman", - inventory_image = "mypacman_1.png", - tiles = { - "mypacman_wallc.png", - "mypacman_1.png", - "mypacman_1.png", - "mypacman_1.png", - "mypacman_1.png", - "mypacman_1.png", - }, - drawtype = "normal", - paramtype = "light", - paramtype2 = "facedir", - light_source = 8, - groups = {cracky = 1}, - on_rightclick = function(pos, node, player, itemstack, pointed_thing) - mypacman.game_start(pos, player) - end, -}) diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/pacmine/blocks.lua b/pacmine/blocks.lua new file mode 100644 index 0000000..79ca2dc --- /dev/null +++ b/pacmine/blocks.lua @@ -0,0 +1,76 @@ +local sbox = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + } + } +local cbox = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} + } + } +local blocks = { +{"Floor", "floor", "floor","floor",0,true}, +{"Wall", "wall", "wall","floor",11,true}, +{"Wallc", "wallc", "wallc","floor",11,true}, +{"Walle", "walle", "walle","floor",11,true}, +{"Wall Walkthrough","walk_wall","wall","floor",11,false}, +} +for i in ipairs(blocks) do +local des = blocks[i][1] +local itm = blocks[i][2] +local i1 = blocks[i][3] +local i2 = blocks[i][4] +local lit = blocks[i][5] +local tf = blocks[i][6] + +minetest.register_alias("mypacman:"..itm, "pacmine:"..itm) + +minetest.register_node("pacmine:"..itm, { + description = des, + tiles = { + "pacmine_"..i1..".png", + "pacmine_"..i2..".png", + "pacmine_walls.png", + "pacmine_walls.png", + "pacmine_walls.png", + "pacmine_walls.png", + }, + drawtype = "normal", + paramtype = "light", + paramtype2 = "facedir", + light_source = lit, + walkable = tf, + groups = {disable_jump = 1, immortal=1, not_in_creative_inventory = 1}, + selection_box = sbox, + collision_box = cbox, + +}) +end +--Glass +minetest.register_alias("mypacman:glass", "pacmine:glass") +minetest.register_node("pacmine:glass", { + description = "glass", + tiles = {"pacmine_glass.png"}, + drawtype = "glasslike", + paramtype = "light", + paramtype2 = "facedir", + groups = {immortal=1,not_in_creative_inventory = 1}, + selection_box = cbox, + collision_box = cbox, + +}) +minetest.register_alias("mypacman:glassw", "pacmine:glassw") +minetest.register_node("pacmine:glassw", { + description = "glassw", + tiles = {"pacmine_glass.png"}, + drawtype = "glasslike", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + groups = {immortal=1,not_in_creative_inventory = 1}, + selection_box = cbox, + colision_box = cbox, + +}) diff --git a/pacmine/craftitems.lua b/pacmine/craftitems.lua new file mode 100644 index 0000000..cab05f0 --- /dev/null +++ b/pacmine/craftitems.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("pacmine:"..itm,{ + description = desc, + inventory_image = "pacmine_"..itm..".png", + tiles = { + "pacmine_"..itm..".png", + "pacmine_"..itm..".png", + "pacmine_"..itm..".png", + "pacmine_"..itm..".png", + "pacmine_"..itm..".png", + "pacmine_"..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) + pacmine.on_player_got_fruit() + end, +}) +end diff --git a/pacmine/gamestate.lua b/pacmine/gamestate.lua new file mode 100755 index 0000000..76c8994 --- /dev/null +++ b/pacmine/gamestate.lua @@ -0,0 +1,296 @@ + +-- Array to hold all the running game states +pacmine.games = {} + +-- Store all the currently playing players +pacmine.players = {} + +-- Duration of the power pellet effect (in seconds) +local power_pellet_duration = 10 + +--------------------------------------------------------- +-- Public functions (these can be called from any other place) + +-- Start the game from the spawn block at position "pos" activated by "player" +function pacmine.game_start(pos, player) + -- create an id unique for the given position + local id = minetest.pos_to_string(pos) + + -- make sure any previous game with the same id has ended + if pacmine.games[id] then + pacmine.game_end(id) + end + + -- Create a new game state with that id and add it to the game list + local gamestate = { + id = id, + player_name = player:get_player_name(), + pos = pos, + start = {x=pos.x+14,y=pos.y+0.5,z=pos.z+16}, + pellet_count = 0, + level = 1, + speed = 2, + lives = 3, + score = 0, + } + pacmine.games[id] = gamestate + pacmine.players[id] = player + + minetest.log("action","New pacman game started at " .. id .. " by " .. gamestate.player_name) + + -- place schematic + local schem = minetest.get_modpath("pacmine").."/schems/pacmine_3.mts" + minetest.place_schematic({x=pos.x,y=pos.y-1,z=pos.z-2},schem,0, "air", true) + + -- Set start positions + pacmine.game_reset(id, player) + pacmine.update_hud(id, player) + minetest.sound_play("pacmine_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,}) +end + +-- Finish the game with the given id +function pacmine.game_end(id) + pacmine.remove_ghosts(id) + pacmine.remove_hud(pacmine.players[id], pacmine.games[id].player_name) + -- Clear the data + pacmine.games[id] = nil + pacmine.players[id] = nil +end + +-- Resets the game to the start positions +function pacmine.game_reset(id, player) + local gamestate = pacmine.games[id] + minetest.log("action", "resetting game " .. id) + + -- Save the time when the game was last resetted (to solve timing issues) + local last_reset = os.time() + + gamestate.power_pellet = false + gamestate.last_reset = last_reset + + -- Position the player + local player = player or minetest.get_player_by_name(gamestate.player_name) + player:setpos(gamestate.start) + + -- Spawn the ghosts and assign the game id to each ghost + minetest.after(2, function() + if pacmine.games[id] and last_reset == pacmine.games[id].last_reset then + local pos = vector.add(gamestate.pos, {x=13,y=0.5,z=19}) + local ghost = minetest.add_entity(pos, "pacmine:inky") + ghost:get_luaentity().gameid = id + end + end) + minetest.after(12, function() + if pacmine.games[id] and last_reset == pacmine.games[id].last_reset then + local pos = vector.add(gamestate.pos, {x=15,y=0.5,z=19}) + local ghost = minetest.add_entity(pos, "pacmine:pinky") + ghost:get_luaentity().gameid = id + end + end) + minetest.after(22, function() + if pacmine.games[id] and last_reset == pacmine.games[id].last_reset then + local pos = vector.add(gamestate.pos, {x=13,y=0.5,z=18}) + local ghost = minetest.add_entity(pos, "pacmine:blinky") + ghost:get_luaentity().gameid = id + end + end) + minetest.after(32, function() + if pacmine.games[id] and last_reset == pacmine.games[id].last_reset then + local pos = vector.add(gamestate.pos, {x=15,y=0.5,z=18}) + local ghost = minetest.add_entity(pos, "pacmine:clyde") + ghost:get_luaentity().gameid = id + end + end) +end + +-- Remove all the ghosts from the board with the given id +function pacmine.remove_ghosts(id) + local gamestate = pacmine.games[id] + if not gamestate then return end + + -- Remove all non-players (ghosts!) + local boardcenter = vector.add(gamestate.pos, {x=13,y=0.5,z=15}) + for index, object in ipairs(minetest.get_objects_inside_radius(boardcenter,20)) do + if object:is_player() ~= true then + object:remove() + end + end +end + +-- A player got a pellet, update the state +function pacmine.on_player_got_pellet(player) + local name = player:get_player_name() + local gamestate = pacmine.get_game_by_player(name) + if not gamestate then return end + + gamestate.pellet_count = gamestate.pellet_count + 1 + gamestate.score = gamestate.score + 10 + pacmine.update_hud(gamestate.id, player) + + if gamestate.pellet_count >= 252 then -- 252 + minetest.chat_send_player(name, "You cleared the board!") + + pacmine.remove_ghosts(gamestate.id) + gamestate.pellet_count = 0 + gamestate.level = gamestate.level + 1 + gamestate.speed = gamestate.level + 1 + + minetest.after(3.0, function() + minetest.chat_send_player(name, "Starting Level "..gamestate.level) + -- place schematic + local schem = minetest.get_modpath("pacmine").."/schems/pacmine_3.mts" + minetest.place_schematic(vector.add(gamestate.pos, {x=0,y=-1,z=-2}),schem,0, "air", true) + + -- Set start positions + pacmine.game_reset(gamestate.id, player) + minetest.sound_play("pacmine_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,}) + end) + end +end + +-- A player got a power pellet, update the state +function pacmine.on_player_got_power_pellet(player) + local name = player:get_player_name() + local gamestate = pacmine.get_game_by_player(name) + if not gamestate then return end + + minetest.chat_send_player(name, "You got a POWER PELLET") + gamestate.power_pellet = os.time() + power_pellet_duration + gamestate.score = gamestate.score + 50 + pacmine.update_hud(gamestate.id, player) + + local boardcenter = vector.add(gamestate.pos, {x=13,y=0.5,z=15}) + local powersound = minetest.sound_play("pacmine_powerup", {pos = boardcenter,max_hear_distance = 20, object=player, loop=true}) + + minetest.after(power_pellet_duration, function() + minetest.sound_stop(powersound) + if os.time() >= (gamestate.power_pellet or 0) then + gamestate.power_pellet = false + minetest.chat_send_player(name, "POWER PELLET wore off") + end + end) +end + +-- Get the game that the given player is playing +function pacmine.get_game_by_player(player_name) + for _,gamestate in pairs(pacmine.games) do + if gamestate.player_name == player_name then + return gamestate + end + end +end + +--------------------------------------------------------- +--- Private functions (only can be used inside this file) + +-- Save Table +local function gamestate_save() + local data = pacmine.games + local f, err = io.open(minetest.get_worldpath().."/pacmine_data", "w") + if err then return err end + f:write(minetest.serialize(data)) + f:close() +end + +--Read Table +local function gamestate_load() + local f, err = io.open(minetest.get_worldpath().."/pacmine_data", "r") + if f then + local data = minetest.deserialize(f:read("*a")) + f:close() + return data + else + return nil + end +end + +-- Called every 0.5 seconds for each player that is currently playing pacman +local function on_player_gamestep(player, gameid) + local player_pos = player:getpos() + local positions = { + {x=0.5,y=0.5,z=0.5}, + {x=-0.5,y=0.5,z=-0.5}, + } + for _,pos in pairs(positions) do + pos = vector.add(player_pos, pos) + local node = minetest.get_node(pos) + if node.name == "pacmine:pellet_1" then + minetest.remove_node(pos) + pacmine.on_player_got_pellet(player) + elseif node.name == "pacmine:pellet_2" then + minetest.remove_node(pos) + pacmine.on_player_got_power_pellet(player) + + minetest.sound_play("pacmine_eatfruit", { + pos = pos, + max_hear_distance = 100, + gain = 10.0, + }) + end + end +end + +------------------- +--- Execution code + +-- load the gamestate from disk +pacmine.games = gamestate_load() or {} + +-- Time counters +local tmr_gamestep = 0 +local tmr_savestep = 0 +minetest.register_globalstep(function(dtime) + tmr_gamestep = tmr_gamestep + dtime; + if tmr_gamestep > 0.2 then + for id,player in pairs(pacmine.players) do + on_player_gamestep(player, id) + end + tmr_savestep = tmr_savestep + tmr_gamestep + if tmr_savestep > 10 then + gamestate_save() + tmr_savestep = 0 + end + tmr_gamestep = 0 + end +end) + +minetest.register_on_joinplayer(function(player) + local name = player:get_player_name() + for id,game in pairs(pacmine.games) do + if game.player_name == name then + pacmine.players[id] = player + pacmine.update_hud(id, player) + end + end +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + for id,game in pairs(pacmine.games) do + if game.player_name == name then + pacmine.players[id] = nil + pacmine.remove_hud(player, name) + end + end +end) + +-- Chatcommand to end the game for the current player +minetest.register_chatcommand("pacmine_exit", { + params = "", + description = "Loads and saves all rooms", + func = function(name, param) + local gamestate = pacmine.get_game_by_player(name) + if gamestate then + pacmine.game_end(gamestate.id) + minetest.get_player_by_name(name):moveto(vector.add(gamestate.pos,{x=0.5,y=0.5,z=-1.5})) + minetest.chat_send_player(name, "You are no longer playing pacman") + else + minetest.chat_send_player(name, "You are not currently in a pacman game") + end + end +}) + +minetest.register_on_shutdown(function() + minetest.log("action", "Server shuts down. Saving pacman data") + gamestate_save() +end) diff --git a/pacmine/ghost.lua b/pacmine/ghost.lua new file mode 100644 index 0000000..7c7c374 --- /dev/null +++ b/pacmine/ghost.lua @@ -0,0 +1,147 @@ + +local ghosts_death_delay = 5 + + +local ghosts = { + {"pinky","Pinky"}, + {"inky","Inky"}, + {"blinky","Blinky"}, + {"clyde","Clyde"}, + } +for i in ipairs(ghosts) do + local itm = ghosts[i][1] + local desc = ghosts[i][2] + + minetest.register_entity("pacmine:"..itm, { + hp_max = 1, + physical = true, + collide_with_objects = true, + visual = "cube", + visual_size = {x = 0.6, y = 1}, + textures = { + "pacmine_"..itm.."s.png", + "pacmine_"..itm.."s.png", + "pacmine_"..itm.."s.png", + "pacmine_"..itm.."s.png", + "pacmine_"..itm.."f.png", + "pacmine_"..itm.."s.png", + }, + velocity = {x=math.random(-1,1), y=0, z=math.random(-1,1)}, + collisionbox = {-0.25, -1.0, -0.25, 0.25, 0.48, 0.25}, + is_visible = true, + automatic_rotate = true, + automatic_face_movement_dir = -90, -- set yaw direction in degrees, false to disable + makes_footstep_sound = false, + + set_velocity = function(self, v) + if not v then v = 0 end + local yaw = self.object:getyaw() + self.object:setvelocity({x=math.sin(yaw) * -v, y=self.object:getvelocity().y, z=math.cos(yaw) * v}) + end, + + on_step = function(self, dtime) + -- every 1 second + self.timer = (self.timer or 0) + dtime + if self.timer < 1 then return end + self.timer = 0 + + -- Do we have game state? if not just die + local gamestate = pacmine.games[self.gameid] + if not gamestate then + minetest.log("action", "Removing pacman ghost without game assigned") + self.object:remove() + return + end + -- Make sure we are in the right state by keeping track of the reset time + -- if the reset time changed it's likely the game got resetted while the entity wasn't loaded + if self.last_reset then + if self.last_reset ~= gamestate.last_reset then + minetest.log("action", "Removing pacman ghost remaining after reset ") + self.object:remove() + end + else + self.last_reset = gamestate.last_reset + end + + -- Make sure we have a targetted player + if not self.target then + self.target = minetest.get_player_by_name(gamestate.player_name) + end + local player = self.target + + -- If there's no player just stop + if not player then + self.set_velocity(self, 0) + return + end + + local s = self.object:getpos() -- ghost + local p = player:getpos() -- player + + -- find distance from ghost to player + local distance = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if distance < 1.5 then + -- player touches ghost!! + + if gamestate.power_pellet then + -- Player eats ghost! move it to spawn + local ghost_spawn = vector.add(gamestate.pos, {x=13,y=0.5,z=19}) + self.object:setpos(ghost_spawn) + -- set the timer negative so it'll have to wait extra time + self.timer = -ghosts_death_delay + -- play sound and reward player + minetest.sound_play("pacmine_eatghost", {pos = boardcenter,max_hear_distance = 6, object=player, loop=false}) + player:get_inventory():add_item('main', 'pacmine:cherrys') + else + -- Ghost catches the player! + gamestate.lives = gamestate.lives - 1 + if gamestate.lives < 1 then + minetest.chat_send_player(gamestate.player_name,"Game Over") + player:moveto(vector.add(gamestate.pos,{x=0.5,y=0.5,z=-1.5})) + pacmine.game_end(self.gameid) + minetest.sound_play("pacmine_death", {pos = boardcenter,max_hear_distance = 20, object=player, loop=false}) + + elseif gamestate.lives == 1 then + minetest.chat_send_player(gamestate.player_name,"This is your last life") + pacmine.game_reset(self.gameid, player) + else + minetest.chat_send_player(gamestate.player_name,"You have ".. gamestate.lives .." lives left") + pacmine.game_reset(self.gameid, player) + end + end + pacmine.update_hud(self.gameid, player) + + else + local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z} + local yaw = (math.atan(vec.z/vec.x)+math.pi/2) + if p.x > s.x then + yaw = yaw + math.pi + end + -- face player and move backwards/forwards + self.object:setyaw(yaw) + if gamestate.power_pellet then + self.set_velocity(self, -gamestate.speed) --negative velocity + else + self.set_velocity(self, gamestate.speed) + end + end + end, + + -- This function should return the saved state of the entity in a string + get_staticdata = function(self) + return (self.gameid or "") .. ";" .. (self.last_reset or "") + end, + + -- This function should load the saved state of the entity from a string + on_activate = function(self, staticdata) + self.object:set_armor_groups({immortal=1}) + if staticdata and staticdata ~= "" then + local data = string.split(staticdata, ";") + if #data == 2 then + self.gameid = data[1] + self.last_reset = tonumber(data[2]) + end + end + end + }) +end diff --git a/pacmine/hud.lua b/pacmine/hud.lua new file mode 100755 index 0000000..162917d --- /dev/null +++ b/pacmine/hud.lua @@ -0,0 +1,43 @@ + + +local hud_table = {} + +function pacmine.update_hud(id, player) + local game = pacmine.games[id] + player = player or minetest.get_player_by_name(game.player_name) + if not player then + return + elseif not game then + pacmine.remove_hud(player) + return + end + + local hudtext = "Score: " .. game.score + .. "\nLevel: " .. game.level + .. "\nLives: " .. game.lives + + local hud = hud_table[game.player_name] + if not hud then + hud = player:hud_add({ + hud_elem_type = "text", + position = {x = 0, y = 1}, + offset = {x=100, y = -100}, + scale = {x = 100, y = 100}, + number = 0x8888FF, --color + text = hudtext + }) + hud_table[game.player_name] = hud + else + player:hud_change(hud, "text", hudtext) + end +end + + +function pacmine.remove_hud(player, playername) + local name = playername or player:get_player_name() + local hud = hud_table[name] + if hud then + player:hud_remove(hud) + hud_table[name] = nil + end +end diff --git a/pacmine/init.lua b/pacmine/init.lua new file mode 100644 index 0000000..c8232b2 --- /dev/null +++ b/pacmine/init.lua @@ -0,0 +1,102 @@ + +-- This variable will be exported to other mods when they "depend" on this mod +pacmine = {} + + +dofile(minetest.get_modpath("pacmine").."/craftitems.lua") +dofile(minetest.get_modpath("pacmine").."/ghost.lua") +dofile(minetest.get_modpath("pacmine").."/blocks.lua") +dofile(minetest.get_modpath("pacmine").."/portals.lua") +dofile(minetest.get_modpath("pacmine").."/gamestate.lua") +dofile(minetest.get_modpath("pacmine").."/hud.lua") + + +--Yellow Pellets +minetest.register_alias("mypacman:pellet_1", "pacmine:pellet_1") +minetest.register_alias("mypacman:pellet_2", "pacmine:pellet_2") +minetest.register_alias("mypacman:block2", "pacmine:block2") +minetest.register_node("pacmine:pellet_1", { + description = "Pellet 1", + tiles = {"wool_yellow.png"}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + light_source = 11, + drop = "", + groups = {dig_immediate = 3, not_in_creative_inventory = 0}, + node_box = { + type = "fixed", + fixed = { + {-0.625, 0.25, -0.125, -0.375, 0.5, 0.125}, + } + }, + on_destruct = function(pos) + minetest.sound_play("pacmine_chomp", { + pos = pos, + max_hear_distance = 100, + gain = 10.0, + }) + end, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pacmine.on_player_got_pellet(digger) + end, +}) + +--Power Pellets. Need to make these do something +minetest.register_node("pacmine:pellet_2", { + description = "Pellet 2", + tiles = {"wool_yellow.png^[colorize:white:140"}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + light_source = 11, + drop = {max_items = 1,items = { + {items = {"pacmine:cherrys"},rarity = 4,}, + {items = {"pacmine:apple"},rarity = 4,}, + {items = {"pacmine:peach"},rarity = 4,}, + {items = {"pacmine:strawberry"},rarity = 4,},}, + }, + groups = {dig_immediate = 3, not_in_creative_inventory = 0}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.125, -0.25, -0.375, 0.125, 0.25}, + {-0.75, -0.125, -0.125, -0.25, 0.125, 0.125}, + {-0.625, -0.25, -0.125, -0.375, 0.25, 0.125}, + {-0.6875, -0.1875, -0.1875, -0.3125, 0.1875, 0.1875}, + } + }, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pacmine.on_player_got_power_pellet(digger) + + minetest.sound_play("pacmine_eatfruit", { + pos = pos, + max_hear_distance = 100, + gain = 10.0, + }) + end, +}) + +--The placer block +minetest.register_node("pacmine:block2",{ + description = "Pacman", + inventory_image = "pacmine_1.png", + tiles = { + "pacmine_wallc.png", + "pacmine_1.png", + "pacmine_1.png", + "pacmine_1.png", + "pacmine_1.png", + "pacmine_1.png", + }, + drawtype = "normal", + paramtype = "light", + paramtype2 = "facedir", + light_source = 8, + groups = {cracky = 1}, + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + pacmine.game_start(pos, player) + end, +}) diff --git a/pacmine/portals.lua b/pacmine/portals.lua new file mode 100644 index 0000000..f40763f --- /dev/null +++ b/pacmine/portals.lua @@ -0,0 +1,73 @@ +local sbox = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0} + } + } +local cbox = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} + } + } + +--Portals +minetest.register_alias("mypacman:portalr", "pacmine:portalr") +minetest.register_node("pacmine:portalr", { + description = "Portalr ", + drawtype = "allfaces", + tiles = {"pacmine_portal.png"}, + paramtype = "light", + sunlight_propagates = true, + light_source = 14, + paramtype2 = "facedir", + walkable = false, + is_ground_content = false, + groups = {snappy = 2, cracky = 2, dig_immediate = 3,not_in_creative_inventory=1}, + selection_box = sbox, + +}) +minetest.register_alias("mypacman:portall", "pacmine:portall") +minetest.register_node("pacmine:portall", { + description = "Portall ", + drawtype = "allfaces", + tiles = {"pacmine_portal.png"}, + paramtype = "light", + sunlight_propagates = true, + light_source = 14, + paramtype2 = "facedir", + walkable = false, + is_ground_content = false, + groups = {snappy = 2, cracky = 2, dig_immediate = 3,not_in_creative_inventory=1}, + selection_box = sbox, + +}) + +minetest.register_abm({ + nodenames = {"pacmine:portall"}, + interval = 0.5, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + for k, player in pairs(objs) do + if player:get_player_name() then + + player:setpos({x=pos.x-23,y=pos.y+0.5,z=pos.z}) + end + end + end +}) +minetest.register_abm({ + nodenames = {"pacmine:portalr"}, + interval = 0.5, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + for k, player in pairs(objs) do + if player:get_player_name() then + + player:setpos({x=pos.x+23,y=pos.y+0.5,z=pos.z}) + end + end + end +}) diff --git a/pacmine/schems/pacmine_3.mts b/pacmine/schems/pacmine_3.mts new file mode 100644 index 0000000..a3124f9 Binary files /dev/null and b/pacmine/schems/pacmine_3.mts differ diff --git a/pacmine/sounds/pacmine_beginning.ogg b/pacmine/sounds/pacmine_beginning.ogg new file mode 100644 index 0000000..2188e55 Binary files /dev/null and b/pacmine/sounds/pacmine_beginning.ogg differ diff --git a/pacmine/sounds/pacmine_chomp.ogg b/pacmine/sounds/pacmine_chomp.ogg new file mode 100644 index 0000000..1d14e93 Binary files /dev/null and b/pacmine/sounds/pacmine_chomp.ogg differ diff --git a/pacmine/sounds/pacmine_death.ogg b/pacmine/sounds/pacmine_death.ogg new file mode 100644 index 0000000..277acb2 Binary files /dev/null and b/pacmine/sounds/pacmine_death.ogg differ diff --git a/pacmine/sounds/pacmine_eatfruit.ogg b/pacmine/sounds/pacmine_eatfruit.ogg new file mode 100644 index 0000000..212782f Binary files /dev/null and b/pacmine/sounds/pacmine_eatfruit.ogg differ diff --git a/pacmine/sounds/pacmine_eatghost.ogg b/pacmine/sounds/pacmine_eatghost.ogg new file mode 100644 index 0000000..f628395 Binary files /dev/null and b/pacmine/sounds/pacmine_eatghost.ogg differ diff --git a/pacmine/sounds/pacmine_extrapac.ogg b/pacmine/sounds/pacmine_extrapac.ogg new file mode 100644 index 0000000..3be1dff Binary files /dev/null and b/pacmine/sounds/pacmine_extrapac.ogg differ diff --git a/pacmine/sounds/pacmine_powerup.ogg b/pacmine/sounds/pacmine_powerup.ogg new file mode 100644 index 0000000..23b2854 Binary files /dev/null and b/pacmine/sounds/pacmine_powerup.ogg differ diff --git a/pacmine/textures/pacmine_1.png b/pacmine/textures/pacmine_1.png new file mode 100644 index 0000000..fac4af2 Binary files /dev/null and b/pacmine/textures/pacmine_1.png differ diff --git a/pacmine/textures/pacmine_apple.png b/pacmine/textures/pacmine_apple.png new file mode 100644 index 0000000..22e060f Binary files /dev/null and b/pacmine/textures/pacmine_apple.png differ diff --git a/pacmine/textures/pacmine_blinkyf.png b/pacmine/textures/pacmine_blinkyf.png new file mode 100644 index 0000000..fb1a17d Binary files /dev/null and b/pacmine/textures/pacmine_blinkyf.png differ diff --git a/pacmine/textures/pacmine_blinkys.png b/pacmine/textures/pacmine_blinkys.png new file mode 100644 index 0000000..79bb09d Binary files /dev/null and b/pacmine/textures/pacmine_blinkys.png differ diff --git a/pacmine/textures/pacmine_cherrys.png b/pacmine/textures/pacmine_cherrys.png new file mode 100644 index 0000000..0009e27 Binary files /dev/null and b/pacmine/textures/pacmine_cherrys.png differ diff --git a/pacmine/textures/pacmine_clydef.png b/pacmine/textures/pacmine_clydef.png new file mode 100644 index 0000000..e041375 Binary files /dev/null and b/pacmine/textures/pacmine_clydef.png differ diff --git a/pacmine/textures/pacmine_clydes.png b/pacmine/textures/pacmine_clydes.png new file mode 100644 index 0000000..14803e7 Binary files /dev/null and b/pacmine/textures/pacmine_clydes.png differ diff --git a/pacmine/textures/pacmine_door.png b/pacmine/textures/pacmine_door.png new file mode 100644 index 0000000..ec92f9e Binary files /dev/null and b/pacmine/textures/pacmine_door.png differ diff --git a/pacmine/textures/pacmine_egg.png b/pacmine/textures/pacmine_egg.png new file mode 100644 index 0000000..fbee286 Binary files /dev/null and b/pacmine/textures/pacmine_egg.png differ diff --git a/pacmine/textures/pacmine_floor.png b/pacmine/textures/pacmine_floor.png new file mode 100644 index 0000000..8e4adc8 Binary files /dev/null and b/pacmine/textures/pacmine_floor.png differ diff --git a/pacmine/textures/pacmine_glass.png b/pacmine/textures/pacmine_glass.png new file mode 100644 index 0000000..2c6dee9 Binary files /dev/null and b/pacmine/textures/pacmine_glass.png differ diff --git a/pacmine/textures/pacmine_inkyf.png b/pacmine/textures/pacmine_inkyf.png new file mode 100644 index 0000000..aba85e3 Binary files /dev/null and b/pacmine/textures/pacmine_inkyf.png differ diff --git a/pacmine/textures/pacmine_inkys.png b/pacmine/textures/pacmine_inkys.png new file mode 100644 index 0000000..c94a44c Binary files /dev/null and b/pacmine/textures/pacmine_inkys.png differ diff --git a/pacmine/textures/pacmine_inv.png b/pacmine/textures/pacmine_inv.png new file mode 100644 index 0000000..244894a Binary files /dev/null and b/pacmine/textures/pacmine_inv.png differ diff --git a/pacmine/textures/pacmine_orange.png b/pacmine/textures/pacmine_orange.png new file mode 100644 index 0000000..68793e6 Binary files /dev/null and b/pacmine/textures/pacmine_orange.png differ diff --git a/pacmine/textures/pacmine_pinkyf.png b/pacmine/textures/pacmine_pinkyf.png new file mode 100644 index 0000000..e31a81b Binary files /dev/null and b/pacmine/textures/pacmine_pinkyf.png differ diff --git a/pacmine/textures/pacmine_pinkys.png b/pacmine/textures/pacmine_pinkys.png new file mode 100644 index 0000000..1731cf8 Binary files /dev/null and b/pacmine/textures/pacmine_pinkys.png differ diff --git a/pacmine/textures/pacmine_portal.png b/pacmine/textures/pacmine_portal.png new file mode 100644 index 0000000..f351ff5 Binary files /dev/null and b/pacmine/textures/pacmine_portal.png differ diff --git a/pacmine/textures/pacmine_strawberry.png b/pacmine/textures/pacmine_strawberry.png new file mode 100644 index 0000000..dcedbe6 Binary files /dev/null and b/pacmine/textures/pacmine_strawberry.png differ diff --git a/pacmine/textures/pacmine_wall.png b/pacmine/textures/pacmine_wall.png new file mode 100644 index 0000000..4f6d2c0 Binary files /dev/null and b/pacmine/textures/pacmine_wall.png differ diff --git a/pacmine/textures/pacmine_wallc.png b/pacmine/textures/pacmine_wallc.png new file mode 100644 index 0000000..548b32f Binary files /dev/null and b/pacmine/textures/pacmine_wallc.png differ diff --git a/pacmine/textures/pacmine_walle.png b/pacmine/textures/pacmine_walle.png new file mode 100644 index 0000000..7f65702 Binary files /dev/null and b/pacmine/textures/pacmine_walle.png differ diff --git a/pacmine/textures/pacmine_walls.png b/pacmine/textures/pacmine_walls.png new file mode 100644 index 0000000..a7c4012 Binary files /dev/null and b/pacmine/textures/pacmine_walls.png differ diff --git a/portals.lua b/portals.lua deleted file mode 100644 index cccd920..0000000 --- a/portals.lua +++ /dev/null @@ -1,71 +0,0 @@ -local sbox = { - type = "fixed", - fixed = { - {0, 0, 0, 0, 0, 0} - } - } -local cbox = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5} - } - } - ---Portals -minetest.register_node("mypacman:portalr", { - description = "Portalr ", - drawtype = "allfaces", - tiles = {"mypacman_portal.png"}, - paramtype = "light", - sunlight_propagates = true, - light_source = 14, - paramtype2 = "facedir", - walkable = false, - is_ground_content = false, - groups = {snappy = 2, cracky = 2, dig_immediate = 3,not_in_creative_inventory=1}, - selection_box = sbox, - -}) -minetest.register_node("mypacman:portall", { - description = "Portall ", - drawtype = "allfaces", - tiles = {"mypacman_portal.png"}, - paramtype = "light", - sunlight_propagates = true, - light_source = 14, - paramtype2 = "facedir", - walkable = false, - is_ground_content = false, - groups = {snappy = 2, cracky = 2, dig_immediate = 3,not_in_creative_inventory=1}, - selection_box = sbox, - -}) - -minetest.register_abm({ - nodenames = {"mypacman:portall"}, - interval = 0.5, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local objs = minetest.env:get_objects_inside_radius(pos, 1) - for k, player in pairs(objs) do - if player:get_player_name() then - - player:setpos({x=pos.x-23,y=pos.y+0.5,z=pos.z}) - end - end - end -}) -minetest.register_abm({ - nodenames = {"mypacman:portalr"}, - interval = 0.5, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local objs = minetest.env:get_objects_inside_radius(pos, 1) - for k, player in pairs(objs) do - if player:get_player_name() then - - player:setpos({x=pos.x+23,y=pos.y+0.5,z=pos.z}) - end - end - end -}) diff --git a/schems/mypacman_3.mts b/schems/mypacman_3.mts deleted file mode 100644 index a3124f9..0000000 Binary files a/schems/mypacman_3.mts and /dev/null differ diff --git a/sounds/mypacman_beginning.ogg b/sounds/mypacman_beginning.ogg deleted file mode 100644 index 2188e55..0000000 Binary files a/sounds/mypacman_beginning.ogg and /dev/null differ diff --git a/sounds/mypacman_chomp.ogg b/sounds/mypacman_chomp.ogg deleted file mode 100644 index 1d14e93..0000000 Binary files a/sounds/mypacman_chomp.ogg and /dev/null differ diff --git a/sounds/mypacman_death.ogg b/sounds/mypacman_death.ogg deleted file mode 100644 index 277acb2..0000000 Binary files a/sounds/mypacman_death.ogg and /dev/null differ diff --git a/sounds/mypacman_eatfruit.ogg b/sounds/mypacman_eatfruit.ogg deleted file mode 100644 index 212782f..0000000 Binary files a/sounds/mypacman_eatfruit.ogg and /dev/null differ diff --git a/sounds/mypacman_eatghost.ogg b/sounds/mypacman_eatghost.ogg deleted file mode 100644 index f628395..0000000 Binary files a/sounds/mypacman_eatghost.ogg and /dev/null differ diff --git a/sounds/mypacman_extrapac.ogg b/sounds/mypacman_extrapac.ogg deleted file mode 100644 index 3be1dff..0000000 Binary files a/sounds/mypacman_extrapac.ogg and /dev/null differ diff --git a/sounds/mypacman_powerup.ogg b/sounds/mypacman_powerup.ogg deleted file mode 100644 index 23b2854..0000000 Binary files a/sounds/mypacman_powerup.ogg and /dev/null differ diff --git a/textures/mypacman_1.png b/textures/mypacman_1.png deleted file mode 100644 index fac4af2..0000000 Binary files a/textures/mypacman_1.png and /dev/null differ diff --git a/textures/mypacman_apple.png b/textures/mypacman_apple.png deleted file mode 100644 index 22e060f..0000000 Binary files a/textures/mypacman_apple.png and /dev/null differ diff --git a/textures/mypacman_blinkyf.png b/textures/mypacman_blinkyf.png deleted file mode 100644 index fb1a17d..0000000 Binary files a/textures/mypacman_blinkyf.png and /dev/null differ diff --git a/textures/mypacman_blinkys.png b/textures/mypacman_blinkys.png deleted file mode 100644 index 79bb09d..0000000 Binary files a/textures/mypacman_blinkys.png and /dev/null differ diff --git a/textures/mypacman_cherrys.png b/textures/mypacman_cherrys.png deleted file mode 100644 index 0009e27..0000000 Binary files a/textures/mypacman_cherrys.png and /dev/null differ diff --git a/textures/mypacman_clydef.png b/textures/mypacman_clydef.png deleted file mode 100644 index e041375..0000000 Binary files a/textures/mypacman_clydef.png and /dev/null differ diff --git a/textures/mypacman_clydes.png b/textures/mypacman_clydes.png deleted file mode 100644 index 14803e7..0000000 Binary files a/textures/mypacman_clydes.png and /dev/null differ diff --git a/textures/mypacman_door.png b/textures/mypacman_door.png deleted file mode 100644 index ec92f9e..0000000 Binary files a/textures/mypacman_door.png and /dev/null differ diff --git a/textures/mypacman_egg.png b/textures/mypacman_egg.png deleted file mode 100644 index fbee286..0000000 Binary files a/textures/mypacman_egg.png and /dev/null differ diff --git a/textures/mypacman_floor.png b/textures/mypacman_floor.png deleted file mode 100644 index 8e4adc8..0000000 Binary files a/textures/mypacman_floor.png and /dev/null differ diff --git a/textures/mypacman_glass.png b/textures/mypacman_glass.png deleted file mode 100644 index 2c6dee9..0000000 Binary files a/textures/mypacman_glass.png and /dev/null differ diff --git a/textures/mypacman_inkyf.png b/textures/mypacman_inkyf.png deleted file mode 100644 index aba85e3..0000000 Binary files a/textures/mypacman_inkyf.png and /dev/null differ diff --git a/textures/mypacman_inkys.png b/textures/mypacman_inkys.png deleted file mode 100644 index c94a44c..0000000 Binary files a/textures/mypacman_inkys.png and /dev/null differ diff --git a/textures/mypacman_inv.png b/textures/mypacman_inv.png deleted file mode 100644 index 244894a..0000000 Binary files a/textures/mypacman_inv.png and /dev/null differ diff --git a/textures/mypacman_orange.png b/textures/mypacman_orange.png deleted file mode 100644 index 68793e6..0000000 Binary files a/textures/mypacman_orange.png and /dev/null differ diff --git a/textures/mypacman_pinkyf.png b/textures/mypacman_pinkyf.png deleted file mode 100644 index e31a81b..0000000 Binary files a/textures/mypacman_pinkyf.png and /dev/null differ diff --git a/textures/mypacman_pinkys.png b/textures/mypacman_pinkys.png deleted file mode 100644 index 1731cf8..0000000 Binary files a/textures/mypacman_pinkys.png and /dev/null differ diff --git a/textures/mypacman_portal.png b/textures/mypacman_portal.png deleted file mode 100644 index f351ff5..0000000 Binary files a/textures/mypacman_portal.png and /dev/null differ diff --git a/textures/mypacman_strawberry.png b/textures/mypacman_strawberry.png deleted file mode 100644 index dcedbe6..0000000 Binary files a/textures/mypacman_strawberry.png and /dev/null differ diff --git a/textures/mypacman_wall.png b/textures/mypacman_wall.png deleted file mode 100644 index 4f6d2c0..0000000 Binary files a/textures/mypacman_wall.png and /dev/null differ diff --git a/textures/mypacman_wallc.png b/textures/mypacman_wallc.png deleted file mode 100644 index 548b32f..0000000 Binary files a/textures/mypacman_wallc.png and /dev/null differ diff --git a/textures/mypacman_walle.png b/textures/mypacman_walle.png deleted file mode 100644 index 7f65702..0000000 Binary files a/textures/mypacman_walle.png and /dev/null differ diff --git a/textures/mypacman_walls.png b/textures/mypacman_walls.png deleted file mode 100644 index a7c4012..0000000 Binary files a/textures/mypacman_walls.png and /dev/null differ -- cgit v1.2.3