parent
a3f90645fd
commit
99f0323635
@ -1,4 +1,4 @@ |
|||||||
function KeyPressed(key) |
function GameKeyPressed(key) |
||||||
if key == "escape" then |
if key == "escape" then |
||||||
love.event.quit() |
love.event.quit() |
||||||
end |
end |
@ -0,0 +1,10 @@ |
|||||||
|
function DrawMenu() |
||||||
|
love.graphics.setFont(GameFont) |
||||||
|
local height = love.graphics.getHeight() |
||||||
|
local width = love.graphics.getWidth() |
||||||
|
love.graphics.setColor(1,1,1) |
||||||
|
love.graphics.rectangle("fill", 0, 0, width, height) |
||||||
|
love.graphics.setColor(0,0,0) |
||||||
|
love.graphics.print("MENU", 100,100) |
||||||
|
|
||||||
|
end |
@ -0,0 +1,10 @@ |
|||||||
|
function MenuKeyPressed(key) |
||||||
|
if key == "escape" then |
||||||
|
love.event.quit() |
||||||
|
end |
||||||
|
|
||||||
|
if key == "space" then |
||||||
|
--Change state to GAME! |
||||||
|
GAMESTATE = "GAME" |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,2 @@ |
|||||||
|
function UpdateMenu(dt) |
||||||
|
end |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@ |
|||||||
|
function LoadMap(lvlnum) |
||||||
|
--TODO: FINISH THIS |
||||||
|
local mapfilelocation = "maps/" |
||||||
|
local extention = ".lua" |
||||||
|
|
||||||
|
--unload the current map |
||||||
|
if GameMap then |
||||||
|
GameMap:removeLayer("Walls") |
||||||
|
end |
||||||
|
|
||||||
|
--load the new map |
||||||
|
GameMap = mapfilelocation .. "map" .. lvlnum .. extention |
||||||
|
|
||||||
|
--load the new map's walls |
||||||
|
Walls = {} |
||||||
|
if GameMap.layers["Walls"] then |
||||||
|
for _, obj in ipairs(GameMap.layers["Walls"].objects) do |
||||||
|
local wall = World:newRectangleCollider(obj.x, obj.y, obj.width, obj.height) |
||||||
|
wall:setType("static") |
||||||
|
table.insert(Walls, wall) |
||||||
|
Walls[#Walls]:setCollisionClass("Wall") |
||||||
|
end |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue