37 lines
739 B
Lua
37 lines
739 B
Lua
local game = require 'assets/scripts/game'
|
|
local background = require 'assets/scripts/background'
|
|
local spaceship = require 'assets/scripts/spaceship'
|
|
local asteroids = require 'assets/scripts/asteroids'
|
|
local controls = require 'assets/scripts/controls'
|
|
|
|
-- LOAD
|
|
function love.load()
|
|
game.load()
|
|
background.load(game)
|
|
asteroids.load(game)
|
|
spaceship.load(game)
|
|
end
|
|
|
|
-- UPDATE
|
|
function love.update(dt)
|
|
game.world:update(dt)
|
|
background.update(dt)
|
|
asteroids.load(dt, game)
|
|
controls.update(dt)
|
|
spaceship.update(dt)
|
|
end
|
|
|
|
-- DRAW
|
|
function love.draw()
|
|
background.draw()
|
|
spaceship.draw()
|
|
end
|
|
|
|
-- CONTROLS
|
|
function love.keyreleased(key)
|
|
-- sounds.keyreleased(key)
|
|
end
|
|
|
|
function love.mousereleased(key)
|
|
-- sounds.mousereleased(key)
|
|
end |