2016-11-14 00:35:14 +01:00
|
|
|
local game = require 'assets/scripts/game'
|
2016-11-12 20:39:10 +01:00
|
|
|
local background = require 'assets/scripts/background'
|
2016-11-12 13:49:24 +01:00
|
|
|
local spaceship = require 'assets/scripts/spaceship'
|
2016-11-14 00:35:14 +01:00
|
|
|
local asteroids = require 'assets/scripts/asteroids'
|
2016-11-12 13:49:24 +01:00
|
|
|
local controls = require 'assets/scripts/controls'
|
2016-11-27 12:31:56 +01:00
|
|
|
local camera = require 'assets/scripts/camera'
|
2016-11-12 13:49:24 +01:00
|
|
|
|
2016-10-18 13:05:26 +02:00
|
|
|
-- LOAD
|
2016-10-17 23:41:41 +02:00
|
|
|
function love.load()
|
2016-11-14 00:35:14 +01:00
|
|
|
game.load()
|
2016-11-27 12:31:56 +01:00
|
|
|
camera.load(game)
|
2016-11-14 00:35:14 +01:00
|
|
|
background.load(game)
|
|
|
|
asteroids.load(game)
|
|
|
|
spaceship.load(game)
|
2016-10-17 09:55:00 +02:00
|
|
|
end
|
|
|
|
|
2016-10-18 13:05:26 +02:00
|
|
|
-- UPDATE
|
2016-10-17 09:55:00 +02:00
|
|
|
function love.update(dt)
|
2016-11-14 00:35:14 +01:00
|
|
|
game.world:update(dt)
|
2016-11-12 20:39:10 +01:00
|
|
|
background.update(dt)
|
2016-11-26 18:26:48 +01:00
|
|
|
asteroids.update(dt, game)
|
2016-11-12 13:49:24 +01:00
|
|
|
spaceship.update(dt)
|
2016-11-27 12:31:56 +01:00
|
|
|
camera.update(game, spaceship)
|
2016-11-26 18:26:48 +01:00
|
|
|
controls.update(dt)
|
2016-10-17 09:55:00 +02:00
|
|
|
end
|
|
|
|
|
2016-10-18 13:05:26 +02:00
|
|
|
-- DRAW
|
2016-10-17 09:55:00 +02:00
|
|
|
function love.draw()
|
2016-11-27 12:31:56 +01:00
|
|
|
camera.gcam:draw(function(l,t,w,h)
|
|
|
|
background.draw()
|
|
|
|
spaceship.draw()
|
|
|
|
asteroids.draw()
|
|
|
|
end)
|
2016-10-27 22:41:44 +02:00
|
|
|
end
|
|
|
|
|
2016-11-12 13:49:24 +01:00
|
|
|
-- CONTROLS
|
2016-10-27 22:41:44 +02:00
|
|
|
function love.keyreleased(key)
|
2016-11-12 13:49:24 +01:00
|
|
|
-- sounds.keyreleased(key)
|
2016-11-04 00:02:10 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function love.mousereleased(key)
|
2016-11-12 13:49:24 +01:00
|
|
|
-- sounds.mousereleased(key)
|
|
|
|
end
|