alligned score board

added pacmini board
master
DonBatman 2015-10-24 21:34:06 -07:00
parent 4a9d35295a
commit cb94946e1e
8 changed files with 54 additions and 12 deletions

View File

@ -4,9 +4,9 @@
local button_form = "size[6,8;]"..
"background[0,0;6,8;myhighscore_form_bg.png]"..
"label[1,0.5;HIGH SCORES]"..
"label[2,0.5;HIGH SCORES]"..
"button[1,1;4,1;game;label]"..
"button_exit[4,7;1,2;exit;Exit]"
"button_exit[2,7;2,1;exit;Exit]"
--place holders
local game_name = "the game"
@ -19,18 +19,18 @@ local function get_formspec_for_game(name)
-- Obtain a comma separated list of scores to display
local scorelist = ""
for _,score in pairs(scores) do
scorelist = scorelist .. minetest.formspec_escape(score.player) ..
"\t\t\t\t " .. score.score ..","
scorelist = scorelist .." ".. minetest.formspec_escape(score.player) ..
"\t\t\t\t " .." ".. score.score ..","
end
return "size[6,8;]"..
"background[0,0;6,8;myhighscore_form_bg.png]"..
"label[1,0.5;HIGH SCORES FOR "..def.description.."]"..
"label[1,1.5;PLAYER]"..
"label[1.25,1.5;PLAYER]"..
"label[3.5,1.5;SCORE]"..
"textlist[0.5,2;5,5;;"..scorelist.."]"..
"button[2,7;1,2;back;Back]"..
"button_exit[4,7;1,2;exit;Exit]"
"button[1,7;2,1;back;Back]"..
"button_exit[3,7;2,1;exit;Exit]"
end

View File

@ -2,7 +2,11 @@ local cbox = {
type = "fixed",
fixed = {{-0.875, 0.125, -0.0625, -0.125, 0.875, 0.0625}}
}
local sbox = {
type = "fixed",
fixed = {{0, 0, 0, 0, 0, 0}}
}
local pelletitems = {
{"cherrys", "Cherrys","2"},
{"apple", "Apple","3"},
@ -26,10 +30,9 @@ minetest.register_node("pacmine:"..itm,{
light_source = 14,
groups = {immortal=1,not_in_creative_inventory = 0},
--node_box = cbox,
selection_box = cbox,
selection_box = sbox,
collision_box = cbox,
on_timer = function(pos, dtime)
print("DELETEEE??")
minetest.remove_node(pos)
end
})

View File

@ -145,15 +145,20 @@ function pacmine.add_fruit(id)
-- Different fruit will be used depending on the level
if gamestate.level == 1 then
node.name = "pacmine:cherrys"
node.param2 = 3
elseif gamestate.level == 2 then
node.name = "pacmine:strawberry"
node.param2 = 3
elseif gamestate.level < 5 then
node.name = "pacmine:orange"
node.param2 = 3
else
node.name = "pacmine:apple"
node.param2 = 3
end
local pos = vector.add(gamestate.start,{x=0,y=-1,z=0})
minetest.set_node(pos, node)
print(node.param2)
-- Set the timer for the fruit to disappear
minetest.get_node_timer(pos):start(math.random(20, 30))
end

View File

@ -29,6 +29,12 @@ minetest.register_node("pacmine:pellet_1", {
{-0.625, 0.25, -0.125, -0.375, 0.5, 0.125},
}
},
selection_box = {
type = "fixed",
fixed = {
{0, 0, 0, 0, 0, 0},
}
},
})
--Power Pellets. Need to make these do something
@ -56,9 +62,15 @@ minetest.register_node("pacmine:pellet_2", {
{-0.6875, -0.1875, -0.1875, -0.3125, 0.1875, 0.1875},
}
},
selection_box = {
type = "fixed",
fixed = {
{0, 0, 0, 0, 0, 0},
}
},
})
--The placer block
--The placer block for pacmine
minetest.register_node("pacmine:block2",{
description = "Pacman",
inventory_image = "pacmine_1.png",
@ -79,3 +91,25 @@ minetest.register_node("pacmine:block2",{
pacmine.game_start(pos, player)
end,
})
--The placer block for pacmine mini
minetest.register_node("pacmine:block",{
description = "Pacman Mini",
inventory_image = "pacmine_1.png^pacmine_mini.png",
tiles = {
"pacmine_wallc.png",
"pacmine_1.png",
"pacmine_1.png",
"pacmine_1.png",
"pacmine_1.png",
"pacmine_1.png^pacmine_mini.png",
},
drawtype = "normal",
paramtype = "light",
paramtype2 = "facedir",
light_source = 8,
groups = {cracky = 1},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local schem = minetest.get_modpath("pacmine").."/schems/pacmini.mts"
minetest.place_schematic({x=pos.x,y=pos.y-1,z=pos.z-2},schem,0, "air", true)
end,
})

BIN
pacmine/schems/pacmini.mts Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

View File

@ -121,6 +121,6 @@ minetest.register_node("pong:block",{
groups = {cracky = 1},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local schem = minetest.get_modpath("pong").."/schems/pong.mts"
minetest.place_schematic(pos,schem,0, "air", true)
minetest.place_schematic({x=pos.x,y=pos.y-1,z=pos.z},schem,0, "air", true)
end,
})

Binary file not shown.