48 lines
867 B
Lua
48 lines
867 B
Lua
function love.load()
|
|
-- Objects, classes
|
|
Object = require("classic")
|
|
require("player")
|
|
require("bullet")
|
|
require("walls")
|
|
|
|
-- Lua files for the game
|
|
require("updateGame")
|
|
require("drawGame")
|
|
require("keyPressed")
|
|
|
|
love.math.setRandomSeed(os.time())
|
|
|
|
GameFont = love.graphics.newFont("Daydream.ttf", 60)
|
|
DebugFont = love.graphics.newFont("Daydream.ttf", 12)
|
|
love.graphics.setFont(GameFont)
|
|
|
|
ScrnHeight = love.graphics.getHeight()
|
|
ScrnWidth = love.graphics.getWidth()
|
|
|
|
UserPlayer1 = Player(400, ScrnHeight - 30, 1, 3, "player1.png", 300)
|
|
UserPlayer2 = Player(200, 0, 2, 3, "player2.png", 300)
|
|
|
|
Bullets1 = {}
|
|
Bullets2 = {}
|
|
|
|
Walls = {}
|
|
|
|
TIMER = 10
|
|
|
|
TimeToPlaceWall = TIMER
|
|
HasP1Won = false
|
|
HasP2Won = false
|
|
end
|
|
|
|
function love.keypressed(key)
|
|
keyPressed(key)
|
|
end
|
|
|
|
function love.update(dt)
|
|
updateGame(dt)
|
|
end
|
|
|
|
function love.draw()
|
|
drawGame()
|
|
end
|