2022-10-13 16:06:52 +02:00
|
|
|
moonshine = nil
|
|
|
|
effect = nil
|
|
|
|
|
|
|
|
currentScene = nil
|
|
|
|
currentPlayer = nil
|
|
|
|
LoadScene = nil
|
|
|
|
TitleScene = nil
|
|
|
|
|
|
|
|
bg = { r= 31/255, g= 44/255, b= 56/255, a= 1 }
|
|
|
|
text = { r=239/255, g= 247/255, b= 255/255, a= 1 }
|
|
|
|
accent = { r=255/255, g= 194/255, b= 62/255, a= 1 }
|
|
|
|
|
|
|
|
lily = require "vendor/lily"
|
|
|
|
|
|
|
|
function love.load()
|
|
|
|
love.mouse.setVisible(false)
|
|
|
|
|
|
|
|
Object = require "vendor/classic"
|
|
|
|
|
2022-10-13 18:18:27 +02:00
|
|
|
require "vendor/math"
|
2022-10-15 17:39:32 +02:00
|
|
|
flux = require "vendor/flux"
|
|
|
|
sfxr = require "vendor.sfxr"
|
2022-10-13 18:18:27 +02:00
|
|
|
|
2022-10-13 16:06:52 +02:00
|
|
|
moonshine = require "shaders"
|
2022-10-15 17:39:32 +02:00
|
|
|
effect = moonshine(moonshine.effects.chromasep).chain(moonshine.effects.godsray).chain(moonshine.effects.vignette).chain(moonshine.effects.filmgrain)
|
|
|
|
effect.chromasep.angle=1
|
|
|
|
effect.chromasep.radius=1
|
|
|
|
effect.godsray.weight=0
|
2022-10-13 16:06:52 +02:00
|
|
|
effect.vignette.softness = 0.4
|
|
|
|
effect.vignette.opacity = 0.2
|
|
|
|
effect.filmgrain.size = 2
|
|
|
|
|
|
|
|
require "scene/load"
|
|
|
|
require "scene/title"
|
|
|
|
require "scene/game"
|
2022-10-13 18:18:27 +02:00
|
|
|
|
2022-10-13 16:06:52 +02:00
|
|
|
require "captain/player"
|
|
|
|
require "captain/robertdavis"
|
|
|
|
require "captain/stevelayer"
|
|
|
|
require "captain/johndanger"
|
|
|
|
|
2022-10-13 18:18:27 +02:00
|
|
|
require "ship/ship"
|
|
|
|
require "ship/blackstar5"
|
|
|
|
require "ship/excaliburiv"
|
|
|
|
require "ship/decorator"
|
|
|
|
|
2022-10-15 23:10:57 +02:00
|
|
|
require "bullet/bullet"
|
|
|
|
|
2022-10-13 20:59:14 +02:00
|
|
|
require "planet/planet"
|
|
|
|
|
2022-10-13 16:06:52 +02:00
|
|
|
LoadScene = LoadScene()
|
|
|
|
TitleScene = TitleScene()
|
|
|
|
GameScene = GameScene()
|
|
|
|
CaptainRobert = RobertDavis()
|
|
|
|
CaptainSteve = SteveLayer()
|
|
|
|
CaptainJohn = JohnDanger()
|
|
|
|
|
|
|
|
currentScene = LoadScene;
|
|
|
|
currentPlayer = CaptainSteve;
|
2022-10-13 20:59:14 +02:00
|
|
|
currentPlanet = Planet()
|
2022-10-13 16:06:52 +02:00
|
|
|
|
|
|
|
require "assets"
|
|
|
|
end
|
|
|
|
|
|
|
|
function love.update(dt)
|
2022-10-15 17:39:32 +02:00
|
|
|
flux.update(dt)
|
2022-10-13 16:06:52 +02:00
|
|
|
if currentScene ~= nil then
|
|
|
|
currentScene:update(dt)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function love.draw()
|
|
|
|
love.graphics.clear(bg.r, bg.g, bg.b, bg.a)
|
|
|
|
love.graphics.setBackgroundColor(bg.r, bg.g, bg.b, bg.a)
|
|
|
|
love.graphics.setColor( text.r, text.g, text.b, text.a )
|
|
|
|
|
|
|
|
if currentScene ~= nil then
|
|
|
|
effect(function()
|
|
|
|
currentScene:draw()
|
|
|
|
end)
|
|
|
|
|
|
|
|
currentScene:drawHud()
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function love.quit()
|
|
|
|
love.mouse.setVisible(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
function love.keypressed( key, unicode )
|
|
|
|
if key == "f4" and (love.keyboard.isDown("ralt") or love.keyboard.isDown("lalt"))
|
|
|
|
or key == "escape" then
|
|
|
|
love.event.quit();
|
|
|
|
end
|
|
|
|
|
|
|
|
if currentScene ~= nil then
|
|
|
|
currentScene:keypressed( key, unicode )
|
|
|
|
end
|
|
|
|
end
|