summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modpack.txt0
-rw-r--r--pacmine/blocks.lua (renamed from blocks.lua)29
-rw-r--r--pacmine/craftitems.lua (renamed from craftitems.lua)18
-rwxr-xr-xpacmine/gamestate.lua (renamed from gamestate.lua)120
-rw-r--r--pacmine/ghost.lua (renamed from ghost.lua)30
-rwxr-xr-xpacmine/hud.lua (renamed from hud.lua)8
-rw-r--r--pacmine/init.lua (renamed from init.lua)55
-rw-r--r--pacmine/portals.lua (renamed from portals.lua)18
-rw-r--r--pacmine/schems/pacmine_3.mts (renamed from schems/mypacman_3.mts)bin1156 -> 1156 bytes
-rw-r--r--pacmine/sounds/pacmine_beginning.ogg (renamed from sounds/mypacman_beginning.ogg)bin17153 -> 17153 bytes
-rw-r--r--pacmine/sounds/pacmine_chomp.ogg (renamed from sounds/mypacman_chomp.ogg)bin7014 -> 7014 bytes
-rw-r--r--pacmine/sounds/pacmine_death.ogg (renamed from sounds/mypacman_death.ogg)bin7619 -> 7619 bytes
-rw-r--r--pacmine/sounds/pacmine_eatfruit.ogg (renamed from sounds/mypacman_eatfruit.ogg)bin4343 -> 4343 bytes
-rw-r--r--pacmine/sounds/pacmine_eatghost.ogg (renamed from sounds/mypacman_eatghost.ogg)bin4687 -> 4687 bytes
-rw-r--r--pacmine/sounds/pacmine_extrapac.ogg (renamed from sounds/mypacman_extrapac.ogg)bin7594 -> 7594 bytes
-rw-r--r--pacmine/sounds/pacmine_powerup.ogg (renamed from sounds/mypacman_powerup.ogg)bin20591 -> 20591 bytes
-rw-r--r--pacmine/textures/pacmine_1.png (renamed from textures/mypacman_1.png)bin473 -> 473 bytes
-rw-r--r--pacmine/textures/pacmine_apple.png (renamed from textures/mypacman_apple.png)bin313 -> 313 bytes
-rw-r--r--pacmine/textures/pacmine_blinkyf.png (renamed from textures/mypacman_blinkyf.png)bin155 -> 155 bytes
-rw-r--r--pacmine/textures/pacmine_blinkys.png (renamed from textures/mypacman_blinkys.png)bin126 -> 126 bytes
-rw-r--r--pacmine/textures/pacmine_cherrys.png (renamed from textures/mypacman_cherrys.png)bin296 -> 296 bytes
-rw-r--r--pacmine/textures/pacmine_clydef.png (renamed from textures/mypacman_clydef.png)bin157 -> 157 bytes
-rw-r--r--pacmine/textures/pacmine_clydes.png (renamed from textures/mypacman_clydes.png)bin126 -> 126 bytes
-rw-r--r--pacmine/textures/pacmine_door.png (renamed from textures/mypacman_door.png)bin126 -> 126 bytes
-rw-r--r--pacmine/textures/pacmine_egg.png (renamed from textures/mypacman_egg.png)bin198 -> 198 bytes
-rw-r--r--pacmine/textures/pacmine_floor.png (renamed from textures/mypacman_floor.png)bin556 -> 556 bytes
-rw-r--r--pacmine/textures/pacmine_glass.png (renamed from textures/mypacman_glass.png)bin431 -> 431 bytes
-rw-r--r--pacmine/textures/pacmine_inkyf.png (renamed from textures/mypacman_inkyf.png)bin158 -> 158 bytes
-rw-r--r--pacmine/textures/pacmine_inkys.png (renamed from textures/mypacman_inkys.png)bin126 -> 126 bytes
-rw-r--r--pacmine/textures/pacmine_inv.png (renamed from textures/mypacman_inv.png)bin274 -> 274 bytes
-rw-r--r--pacmine/textures/pacmine_orange.png (renamed from textures/mypacman_orange.png)bin377 -> 377 bytes
-rw-r--r--pacmine/textures/pacmine_pinkyf.png (renamed from textures/mypacman_pinkyf.png)bin158 -> 158 bytes
-rw-r--r--pacmine/textures/pacmine_pinkys.png (renamed from textures/mypacman_pinkys.png)bin127 -> 127 bytes
-rw-r--r--pacmine/textures/pacmine_portal.png (renamed from textures/mypacman_portal.png)bin450 -> 450 bytes
-rw-r--r--pacmine/textures/pacmine_strawberry.png (renamed from textures/mypacman_strawberry.png)bin386 -> 386 bytes
-rw-r--r--pacmine/textures/pacmine_wall.png (renamed from textures/mypacman_wall.png)bin498 -> 498 bytes
-rw-r--r--pacmine/textures/pacmine_wallc.png (renamed from textures/mypacman_wallc.png)bin500 -> 500 bytes
-rw-r--r--pacmine/textures/pacmine_walle.png (renamed from textures/mypacman_walle.png)bin465 -> 465 bytes
-rw-r--r--pacmine/textures/pacmine_walls.png (renamed from textures/mypacman_walls.png)bin467 -> 467 bytes
39 files changed, 142 insertions, 136 deletions
diff --git a/modpack.txt b/modpack.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modpack.txt
diff --git a/blocks.lua b/pacmine/blocks.lua
index 93fbfe5..79ca2dc 100644
--- a/blocks.lua
+++ b/pacmine/blocks.lua
@@ -25,15 +25,17 @@ local i2 = blocks[i][4]
local lit = blocks[i][5]
local tf = blocks[i][6]
-minetest.register_node("mypacman:"..itm, {
+minetest.register_alias("mypacman:"..itm, "pacmine:"..itm)
+
+minetest.register_node("pacmine:"..itm, {
description = des,
tiles = {
- "mypacman_"..i1..".png",
- "mypacman_"..i2..".png",
- "mypacman_walls.png",
- "mypacman_walls.png",
- "mypacman_walls.png",
- "mypacman_walls.png",
+ "pacmine_"..i1..".png",
+ "pacmine_"..i2..".png",
+ "pacmine_walls.png",
+ "pacmine_walls.png",
+ "pacmine_walls.png",
+ "pacmine_walls.png",
},
drawtype = "normal",
paramtype = "light",
@@ -47,9 +49,10 @@ minetest.register_node("mypacman:"..itm, {
})
end
--Glass
-minetest.register_node("mypacman:glass", {
+minetest.register_alias("mypacman:glass", "pacmine:glass")
+minetest.register_node("pacmine:glass", {
description = "glass",
- tiles = {"mypacman_glass.png"},
+ tiles = {"pacmine_glass.png"},
drawtype = "glasslike",
paramtype = "light",
paramtype2 = "facedir",
@@ -58,9 +61,10 @@ minetest.register_node("mypacman:glass", {
collision_box = cbox,
})
-minetest.register_node("mypacman:glassw", {
+minetest.register_alias("mypacman:glassw", "pacmine:glassw")
+minetest.register_node("pacmine:glassw", {
description = "glassw",
- tiles = {"mypacman_glass.png"},
+ tiles = {"pacmine_glass.png"},
drawtype = "glasslike",
paramtype = "light",
paramtype2 = "facedir",
@@ -70,6 +74,3 @@ minetest.register_node("mypacman:glassw", {
colision_box = cbox,
})
-
-
-
diff --git a/craftitems.lua b/pacmine/craftitems.lua
index 8648363..cab05f0 100644
--- a/craftitems.lua
+++ b/pacmine/craftitems.lua
@@ -71,16 +71,16 @@ for i in ipairs (pelletitems) do
local hlth = pelletitems[i][3]
local cbox = pelletitems[i][4]
-minetest.register_node("mypacman:"..itm,{
+minetest.register_node("pacmine:"..itm,{
description = desc,
- inventory_image = "mypacman_"..itm..".png",
+ inventory_image = "pacmine_"..itm..".png",
tiles = {
- "mypacman_"..itm..".png",
- "mypacman_"..itm..".png",
- "mypacman_"..itm..".png",
- "mypacman_"..itm..".png",
- "mypacman_"..itm..".png",
- "mypacman_"..itm..".png^[transformFX",
+ "pacmine_"..itm..".png",
+ "pacmine_"..itm..".png",
+ "pacmine_"..itm..".png",
+ "pacmine_"..itm..".png",
+ "pacmine_"..itm..".png",
+ "pacmine_"..itm..".png^[transformFX",
},
drawtype = "nodebox",
paramtype = "light",
@@ -91,7 +91,7 @@ minetest.register_node("mypacman:"..itm,{
node_box = cbox,
collision_box = cbox,
after_destruct = function(pos, oldnode)
- mypacman.on_player_got_fruit()
+ pacmine.on_player_got_fruit()
end,
})
end
diff --git a/gamestate.lua b/pacmine/gamestate.lua
index 1cad7f4..76c8994 100755
--- a/gamestate.lua
+++ b/pacmine/gamestate.lua
@@ -1,9 +1,9 @@
-- Array to hold all the running game states
-mypacman.games = {}
+pacmine.games = {}
-- Store all the currently playing players
-mypacman.players = {}
+pacmine.players = {}
-- Duration of the power pellet effect (in seconds)
local power_pellet_duration = 10
@@ -12,13 +12,13 @@ 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)
+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 mypacman.games[id] then
- mypacman.game_end(id)
+ 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
@@ -33,33 +33,33 @@ function mypacman.game_start(pos, player)
lives = 3,
score = 0,
}
- mypacman.games[id] = gamestate
- mypacman.players[id] = player
+ 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("mypacman").."/schems/mypacman_3.mts"
+ 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
- mypacman.game_reset(id, player)
- mypacman.update_hud(id, player)
- minetest.sound_play("mypacman_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,})
+ 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 mypacman.game_end(id)
- mypacman.remove_ghosts(id)
- mypacman.remove_hud(mypacman.players[id], mypacman.games[id].player_name)
+function pacmine.game_end(id)
+ pacmine.remove_ghosts(id)
+ pacmine.remove_hud(pacmine.players[id], pacmine.games[id].player_name)
-- Clear the data
- mypacman.games[id] = nil
- mypacman.players[id] = nil
+ pacmine.games[id] = nil
+ pacmine.players[id] = nil
end
-- Resets the game to the start positions
-function mypacman.game_reset(id, player)
- local gamestate = mypacman.games[id]
+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)
@@ -74,38 +74,38 @@ function mypacman.game_reset(id, player)
-- 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
+ 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, "mypacman:inky")
+ local ghost = minetest.add_entity(pos, "pacmine: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
+ 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, "mypacman:pinky")
+ local ghost = minetest.add_entity(pos, "pacmine: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
+ 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, "mypacman:blinky")
+ local ghost = minetest.add_entity(pos, "pacmine: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
+ 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, "mypacman:clyde")
+ 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 mypacman.remove_ghosts(id)
- local gamestate = mypacman.games[id]
+function pacmine.remove_ghosts(id)
+ local gamestate = pacmine.games[id]
if not gamestate then return end
-- Remove all non-players (ghosts!)
@@ -118,19 +118,19 @@ function mypacman.remove_ghosts(id)
end
-- A player got a pellet, update the state
-function mypacman.on_player_got_pellet(player)
+function pacmine.on_player_got_pellet(player)
local name = player:get_player_name()
- local gamestate = mypacman.get_game_by_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
- mypacman.update_hud(gamestate.id, player)
+ pacmine.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)
+ pacmine.remove_ghosts(gamestate.id)
gamestate.pellet_count = 0
gamestate.level = gamestate.level + 1
gamestate.speed = gamestate.level + 1
@@ -138,29 +138,29 @@ function mypacman.on_player_got_pellet(player)
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"
+ 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
- mypacman.game_reset(gamestate.id, player)
- minetest.sound_play("mypacman_beginning", {pos = pos,max_hear_distance = 40,gain = 10.0,})
+ 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 mypacman.on_player_got_power_pellet(player)
+function pacmine.on_player_got_power_pellet(player)
local name = player:get_player_name()
- local gamestate = mypacman.get_game_by_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
- mypacman.update_hud(gamestate.id, player)
+ pacmine.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})
+ 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)
@@ -172,8 +172,8 @@ function mypacman.on_player_got_power_pellet(player)
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
+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
@@ -185,8 +185,8 @@ end
-- Save Table
local function gamestate_save()
- local data = mypacman.games
- local f, err = io.open(minetest.get_worldpath().."/mypacman_data", "w")
+ 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()
@@ -194,7 +194,7 @@ end
--Read Table
local function gamestate_load()
- local f, err = io.open(minetest.get_worldpath().."/mypacman_data", "r")
+ local f, err = io.open(minetest.get_worldpath().."/pacmine_data", "r")
if f then
local data = minetest.deserialize(f:read("*a"))
f:close()
@@ -214,14 +214,14 @@ local function on_player_gamestep(player, gameid)
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
+ if node.name == "pacmine:pellet_1" then
minetest.remove_node(pos)
- mypacman.on_player_got_pellet(player)
- elseif node.name == "mypacman:pellet_2" then
+ pacmine.on_player_got_pellet(player)
+ elseif node.name == "pacmine:pellet_2" then
minetest.remove_node(pos)
- mypacman.on_player_got_power_pellet(player)
+ pacmine.on_player_got_power_pellet(player)
- minetest.sound_play("mypacman_eatfruit", {
+ minetest.sound_play("pacmine_eatfruit", {
pos = pos,
max_hear_distance = 100,
gain = 10.0,
@@ -234,7 +234,7 @@ end
--- Execution code
-- load the gamestate from disk
-mypacman.games = gamestate_load() or {}
+pacmine.games = gamestate_load() or {}
-- Time counters
local tmr_gamestep = 0
@@ -242,7 +242,7 @@ 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
+ for id,player in pairs(pacmine.players) do
on_player_gamestep(player, id)
end
tmr_savestep = tmr_savestep + tmr_gamestep
@@ -256,32 +256,32 @@ end)
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
- for id,game in pairs(mypacman.games) do
+ for id,game in pairs(pacmine.games) do
if game.player_name == name then
- mypacman.players[id] = player
- mypacman.update_hud(id, player)
+ 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(mypacman.games) do
+ for id,game in pairs(pacmine.games) do
if game.player_name == name then
- mypacman.players[id] = nil
- mypacman.remove_hud(player, name)
+ pacmine.players[id] = nil
+ pacmine.remove_hud(player, name)
end
end
end)
-- Chatcommand to end the game for the current player
-minetest.register_chatcommand("mypacman_exit", {
+minetest.register_chatcommand("pacmine_exit", {
params = "",
description = "Loads and saves all rooms",
func = function(name, param)
- local gamestate = mypacman.get_game_by_player(name)
+ local gamestate = pacmine.get_game_by_player(name)
if gamestate then
- mypacman.game_end(gamestate.id)
+ 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
diff --git a/ghost.lua b/pacmine/ghost.lua
index 1c9e47e..7c7c374 100644
--- a/ghost.lua
+++ b/pacmine/ghost.lua
@@ -12,19 +12,19 @@ for i in ipairs(ghosts) do
local itm = ghosts[i][1]
local desc = ghosts[i][2]
- minetest.register_entity("mypacman:"..itm, {
+ minetest.register_entity("pacmine:"..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",
+ "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},
@@ -46,7 +46,7 @@ for i in ipairs(ghosts) do
self.timer = 0
-- Do we have game state? if not just die
- local gamestate = mypacman.games[self.gameid]
+ local gamestate = pacmine.games[self.gameid]
if not gamestate then
minetest.log("action", "Removing pacman ghost without game assigned")
self.object:remove()
@@ -90,26 +90,26 @@ for i in ipairs(ghosts) do
-- 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')
+ 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}))
- mypacman.game_end(self.gameid)
- minetest.sound_play("mypacman_death", {pos = boardcenter,max_hear_distance = 20, object=player, loop=false})
+ 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")
- mypacman.game_reset(self.gameid, player)
+ pacmine.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)
+ pacmine.game_reset(self.gameid, player)
end
end
- mypacman.update_hud(self.gameid, player)
+ pacmine.update_hud(self.gameid, player)
else
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
diff --git a/hud.lua b/pacmine/hud.lua
index 791e422..162917d 100755
--- a/hud.lua
+++ b/pacmine/hud.lua
@@ -2,13 +2,13 @@
local hud_table = {}
-function mypacman.update_hud(id, player)
- local game = mypacman.games[id]
+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
- mypacman.remove_hud(player)
+ pacmine.remove_hud(player)
return
end
@@ -33,7 +33,7 @@ function mypacman.update_hud(id, player)
end
-function mypacman.remove_hud(player, playername)
+function pacmine.remove_hud(player, playername)
local name = playername or player:get_player_name()
local hud = hud_table[name]
if hud then
diff --git a/init.lua b/pacmine/init.lua
index 69c0df7..c8232b2 100644
--- a/init.lua
+++ b/pacmine/init.lua
@@ -1,18 +1,21 @@
-- This variable will be exported to other mods when they "depend" on this mod
-mypacman = {}
+pacmine = {}
-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")
+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_node("mypacman:pellet_1", {
+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",
@@ -29,19 +32,19 @@ minetest.register_node("mypacman:pellet_1", {
}
},
on_destruct = function(pos)
- minetest.sound_play("mypacman_chomp", {
+ minetest.sound_play("pacmine_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)
+ pacmine.on_player_got_pellet(digger)
end,
})
--Power Pellets. Need to make these do something
-minetest.register_node("mypacman:pellet_2", {
+minetest.register_node("pacmine:pellet_2", {
description = "Pellet 2",
tiles = {"wool_yellow.png^[colorize:white:140"},
drawtype = "nodebox",
@@ -50,10 +53,10 @@ minetest.register_node("mypacman:pellet_2", {
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,},},
+ {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 = {
@@ -66,9 +69,9 @@ minetest.register_node("mypacman:pellet_2", {
}
},
after_dig_node = function(pos, oldnode, oldmetadata, digger)
- mypacman.on_player_got_power_pellet(digger)
+ pacmine.on_player_got_power_pellet(digger)
- minetest.sound_play("mypacman_eatfruit", {
+ minetest.sound_play("pacmine_eatfruit", {
pos = pos,
max_hear_distance = 100,
gain = 10.0,
@@ -77,16 +80,16 @@ minetest.register_node("mypacman:pellet_2", {
})
--The placer block
-minetest.register_node("mypacman:block2",{
+minetest.register_node("pacmine:block2",{
description = "Pacman",
- inventory_image = "mypacman_1.png",
+ inventory_image = "pacmine_1.png",
tiles = {
- "mypacman_wallc.png",
- "mypacman_1.png",
- "mypacman_1.png",
- "mypacman_1.png",
- "mypacman_1.png",
- "mypacman_1.png",
+ "pacmine_wallc.png",
+ "pacmine_1.png",
+ "pacmine_1.png",
+ "pacmine_1.png",
+ "pacmine_1.png",
+ "pacmine_1.png",
},
drawtype = "normal",
paramtype = "light",
@@ -94,6 +97,6 @@ minetest.register_node("mypacman:block2",{
light_source = 8,
groups = {cracky = 1},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
- mypacman.game_start(pos, player)
+ pacmine.game_start(pos, player)
end,
})
diff --git a/portals.lua b/pacmine/portals.lua
index cccd920..f40763f 100644
--- a/portals.lua
+++ b/pacmine/portals.lua
@@ -12,10 +12,11 @@ local cbox = {
}
--Portals
-minetest.register_node("mypacman:portalr", {
+minetest.register_alias("mypacman:portalr", "pacmine:portalr")
+minetest.register_node("pacmine:portalr", {
description = "Portalr ",
drawtype = "allfaces",
- tiles = {"mypacman_portal.png"},
+ tiles = {"pacmine_portal.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 14,
@@ -26,10 +27,11 @@ minetest.register_node("mypacman:portalr", {
selection_box = sbox,
})
-minetest.register_node("mypacman:portall", {
+minetest.register_alias("mypacman:portall", "pacmine:portall")
+minetest.register_node("pacmine:portall", {
description = "Portall ",
drawtype = "allfaces",
- tiles = {"mypacman_portal.png"},
+ tiles = {"pacmine_portal.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 14,
@@ -42,13 +44,13 @@ minetest.register_node("mypacman:portall", {
})
minetest.register_abm({
- nodenames = {"mypacman:portall"},
+ 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
+ if player:get_player_name() then
player:setpos({x=pos.x-23,y=pos.y+0.5,z=pos.z})
end
@@ -56,13 +58,13 @@ minetest.register_abm({
end
})
minetest.register_abm({
- nodenames = {"mypacman:portalr"},
+ 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
+ if player:get_player_name() then
player:setpos({x=pos.x+23,y=pos.y+0.5,z=pos.z})
end
diff --git a/schems/mypacman_3.mts b/pacmine/schems/pacmine_3.mts
index a3124f9..a3124f9 100644
--- a/schems/mypacman_3.mts
+++ b/pacmine/schems/pacmine_3.mts
Binary files differ
diff --git a/sounds/mypacman_beginning.ogg b/pacmine/sounds/pacmine_beginning.ogg
index 2188e55..2188e55 100644
--- a/sounds/mypacman_beginning.ogg
+++ b/pacmine/sounds/pacmine_beginning.ogg
Binary files differ
diff --git a/sounds/mypacman_chomp.ogg b/pacmine/sounds/pacmine_chomp.ogg
index 1d14e93..1d14e93 100644
--- a/sounds/mypacman_chomp.ogg
+++ b/pacmine/sounds/pacmine_chomp.ogg
Binary files differ
diff --git a/sounds/mypacman_death.ogg b/pacmine/sounds/pacmine_death.ogg
index 277acb2..277acb2 100644
--- a/sounds/mypacman_death.ogg
+++ b/pacmine/sounds/pacmine_death.ogg
Binary files differ
diff --git a/sounds/mypacman_eatfruit.ogg b/pacmine/sounds/pacmine_eatfruit.ogg
index 212782f..212782f 100644
--- a/sounds/mypacman_eatfruit.ogg
+++ b/pacmine/sounds/pacmine_eatfruit.ogg
Binary files differ
diff --git a/sounds/mypacman_eatghost.ogg b/pacmine/sounds/pacmine_eatghost.ogg
index f628395..f628395 100644
--- a/sounds/mypacman_eatghost.ogg
+++ b/pacmine/sounds/pacmine_eatghost.ogg
Binary files differ
diff --git a/sounds/mypacman_extrapac.ogg b/pacmine/sounds/pacmine_extrapac.ogg
index 3be1dff..3be1dff 100644
--- a/sounds/mypacman_extrapac.ogg
+++ b/pacmine/sounds/pacmine_extrapac.ogg
Binary files differ
diff --git a/sounds/mypacman_powerup.ogg b/pacmine/sounds/pacmine_powerup.ogg
index 23b2854..23b2854 100644
--- a/sounds/mypacman_powerup.ogg
+++ b/pacmine/sounds/pacmine_powerup.ogg
Binary files differ
diff --git a/textures/mypacman_1.png b/pacmine/textures/pacmine_1.png
index fac4af2..fac4af2 100644
--- a/textures/mypacman_1.png
+++ b/pacmine/textures/pacmine_1.png
Binary files differ
diff --git a/textures/mypacman_apple.png b/pacmine/textures/pacmine_apple.png
index 22e060f..22e060f 100644
--- a/textures/mypacman_apple.png
+++ b/pacmine/textures/pacmine_apple.png
Binary files differ
diff --git a/textures/mypacman_blinkyf.png b/pacmine/textures/pacmine_blinkyf.png
index fb1a17d..fb1a17d 100644
--- a/textures/mypacman_blinkyf.png
+++ b/pacmine/textures/pacmine_blinkyf.png
Binary files differ
diff --git a/textures/mypacman_blinkys.png b/pacmine/textures/pacmine_blinkys.png
index 79bb09d..79bb09d 100644
--- a/textures/mypacman_blinkys.png
+++ b/pacmine/textures/pacmine_blinkys.png
Binary files differ
diff --git a/textures/mypacman_cherrys.png b/pacmine/textures/pacmine_cherrys.png
index 0009e27..0009e27 100644
--- a/textures/mypacman_cherrys.png
+++ b/pacmine/textures/pacmine_cherrys.png
Binary files differ
diff --git a/textures/mypacman_clydef.png b/pacmine/textures/pacmine_clydef.png
index e041375..e041375 100644
--- a/textures/mypacman_clydef.png
+++ b/pacmine/textures/pacmine_clydef.png
Binary files differ
diff --git a/textures/mypacman_clydes.png b/pacmine/textures/pacmine_clydes.png
index 14803e7..14803e7 100644
--- a/textures/mypacman_clydes.png
+++ b/pacmine/textures/pacmine_clydes.png
Binary files differ
diff --git a/textures/mypacman_door.png b/pacmine/textures/pacmine_door.png
index ec92f9e..ec92f9e 100644
--- a/textures/mypacman_door.png
+++ b/pacmine/textures/pacmine_door.png
Binary files differ
diff --git a/textures/mypacman_egg.png b/pacmine/textures/pacmine_egg.png
index fbee286..fbee286 100644
--- a/textures/mypacman_egg.png
+++ b/pacmine/textures/pacmine_egg.png
Binary files differ
diff --git a/textures/mypacman_floor.png b/pacmine/textures/pacmine_floor.png
index 8e4adc8..8e4adc8 100644
--- a/textures/mypacman_floor.png
+++ b/pacmine/textures/pacmine_floor.png
Binary files differ
diff --git a/textures/mypacman_glass.png b/pacmine/textures/pacmine_glass.png
index 2c6dee9..2c6dee9 100644
--- a/textures/mypacman_glass.png
+++ b/pacmine/textures/pacmine_glass.png
Binary files differ
diff --git a/textures/mypacman_inkyf.png b/pacmine/textures/pacmine_inkyf.png
index aba85e3..aba85e3 100644
--- a/textures/mypacman_inkyf.png
+++ b/pacmine/textures/pacmine_inkyf.png
Binary files differ
diff --git a/textures/mypacman_inkys.png b/pacmine/textures/pacmine_inkys.png
index c94a44c..c94a44c 100644
--- a/textures/mypacman_inkys.png
+++ b/pacmine/textures/pacmine_inkys.png
Binary files differ
diff --git a/textures/mypacman_inv.png b/pacmine/textures/pacmine_inv.png
index 244894a..244894a 100644
--- a/textures/mypacman_inv.png
+++ b/pacmine/textures/pacmine_inv.png
Binary files differ
diff --git a/textures/mypacman_orange.png b/pacmine/textures/pacmine_orange.png
index 68793e6..68793e6 100644
--- a/textures/mypacman_orange.png
+++ b/pacmine/textures/pacmine_orange.png
Binary files differ
diff --git a/textures/mypacman_pinkyf.png b/pacmine/textures/pacmine_pinkyf.png
index e31a81b..e31a81b 100644
--- a/textures/mypacman_pinkyf.png
+++ b/pacmine/textures/pacmine_pinkyf.png
Binary files differ
diff --git a/textures/mypacman_pinkys.png b/pacmine/textures/pacmine_pinkys.png
index 1731cf8..1731cf8 100644
--- a/textures/mypacman_pinkys.png
+++ b/pacmine/textures/pacmine_pinkys.png
Binary files differ
diff --git a/textures/mypacman_portal.png b/pacmine/textures/pacmine_portal.png
index f351ff5..f351ff5 100644
--- a/textures/mypacman_portal.png
+++ b/pacmine/textures/pacmine_portal.png
Binary files differ
diff --git a/textures/mypacman_strawberry.png b/pacmine/textures/pacmine_strawberry.png
index dcedbe6..dcedbe6 100644
--- a/textures/mypacman_strawberry.png
+++ b/pacmine/textures/pacmine_strawberry.png
Binary files differ
diff --git a/textures/mypacman_wall.png b/pacmine/textures/pacmine_wall.png
index 4f6d2c0..4f6d2c0 100644
--- a/textures/mypacman_wall.png
+++ b/pacmine/textures/pacmine_wall.png
Binary files differ
diff --git a/textures/mypacman_wallc.png b/pacmine/textures/pacmine_wallc.png
index 548b32f..548b32f 100644
--- a/textures/mypacman_wallc.png
+++ b/pacmine/textures/pacmine_wallc.png
Binary files differ
diff --git a/textures/mypacman_walle.png b/pacmine/textures/pacmine_walle.png
index 7f65702..7f65702 100644
--- a/textures/mypacman_walle.png
+++ b/pacmine/textures/pacmine_walle.png
Binary files differ
diff --git a/textures/mypacman_walls.png b/pacmine/textures/pacmine_walls.png
index a7c4012..a7c4012 100644
--- a/textures/mypacman_walls.png
+++ b/pacmine/textures/pacmine_walls.png
Binary files differ