This game is not finished and there isn't much to play. But I felt it was a massive waste of time if I just let it rot on my hard drive. And for some people it's nice to look at code of working games.
It's pretty modular too. Here's how levels are made.
Code: Select all
LEVEL.Category = "Yummy Custom Levels"
LEVEL.ID = 1
LEVEL.Name = "Level the first one"
LEVEL.Map = {
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,1,3,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
}
function LEVEL:Start()
Player:SetPos(2,2)
AddItem( 10, 7, "Crate" )
local light = AddItem( 5, 5, "Light" )
local tile = GetTile(5, 6)
function tile:OnPushOver( item, xdir, ydir )
if item.type == "Crate" then
light:TurnOn()
end
end
end