mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Love2D 11.3 port
This commit is contained in:
+7
-7
@@ -12,14 +12,14 @@ assets.img_explosion = love.graphics.newImage("assets/explosion.png")
|
||||
assets.img_pig = love.graphics.newImage("assets/pig.png")
|
||||
assets.img_spawner = love.graphics.newImage("assets/spawner.png")
|
||||
|
||||
assets.snd_catjump = multisource.new(love.audio.newSource("assets/catjump.wav"))
|
||||
assets.snd_cannon = multisource.new(love.audio.newSource("assets/cannon.wav"))
|
||||
assets.snd_thud = multisource.new(love.audio.newSource("assets/thud.wav"))
|
||||
assets.snd_meow = multisource.new(love.audio.newSource("assets/meow.ogg"))
|
||||
assets.snd_oink = multisource.new(love.audio.newSource("assets/oink.ogg"))
|
||||
assets.snd_yay = multisource.new(love.audio.newSource("assets/yay.wav"))
|
||||
assets.snd_catjump = multisource.new(love.audio.newSource("assets/catjump.wav", "static"))
|
||||
assets.snd_cannon = multisource.new(love.audio.newSource("assets/cannon.wav", "static"))
|
||||
assets.snd_thud = multisource.new(love.audio.newSource("assets/thud.wav", "static"))
|
||||
assets.snd_meow = multisource.new(love.audio.newSource("assets/meow.ogg", "static"))
|
||||
assets.snd_oink = multisource.new(love.audio.newSource("assets/oink.ogg", "static"))
|
||||
assets.snd_yay = multisource.new(love.audio.newSource("assets/yay.wav", "static"))
|
||||
|
||||
assets.snd_music = love.audio.newSource("assets/music.ogg")
|
||||
assets.snd_music = love.audio.newSource("assets/music.ogg", "stream")
|
||||
|
||||
assets.fnt_hud = love.graphics.newFont("assets/font.ttf", 48)
|
||||
assets.fnt_smallhud = love.graphics.newFont("assets/font.ttf", 32)
|
||||
|
||||
@@ -18,7 +18,7 @@ end
|
||||
|
||||
function TransitionScreen:drawHud(dt)
|
||||
local r1, g1, b1, a = love.graphics.getColor()
|
||||
love.graphics.setColor(0, 0, 0, self.alpha * 255)
|
||||
love.graphics.setColor(0, 0, 0, self.alpha)
|
||||
love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight())
|
||||
love.graphics.setColor(r1, g1, b1, a)
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ function Intro:load()
|
||||
require ("src.systems.HudSystem")("hudBg"),
|
||||
require ("src.systems.HudSystem")("hudFg"),
|
||||
TransitionScreen(),
|
||||
ScreenSplash(0.5, 0.2, "Cammando Kibbles"),
|
||||
ScreenSplash(0.5, 0.2, "Commando Kibbles"),
|
||||
ScreenSplash(0, 0, "Created by bakpakin for Ludum Dare 32", 300, assets.fnt_reallysmallhud, "left", 20, 20),
|
||||
ScreenSplash(0.5, 0.36, "Press Space to Start", 500, assets.fnt_smallhud),
|
||||
ScreenSplash(0.5, 0.45, "Controls:\nMove - WASD\nRotate Cannon - Arrow Keys\nFire - Down\nToggle Fullscreen - \\\nToggle Music - M\nPause - P\nEscape - Quit", 800, assets.fnt_reallysmallhud)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
local DrawBackgroundSystem = tiny.system(class "DrawBackgroundSystem")
|
||||
|
||||
function DrawBackgroundSystem:init(r, g, b)
|
||||
self.r, self.g, self.b = r, g, b
|
||||
self.r, self.g, self.b = (r / 255), (g / 255), (b / 255)
|
||||
end
|
||||
|
||||
function DrawBackgroundSystem:update(dt)
|
||||
local r1, g1, b1, a = love.graphics.getColor()
|
||||
love.graphics.setColor(self.r, self.g, self.b, 255)
|
||||
love.graphics.setColor(self.r, self.g, self.b, 1)
|
||||
love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight())
|
||||
love.graphics.setColor(r1, g1, b1, a)
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ end
|
||||
|
||||
function SpriteSystem:postProcess(dt)
|
||||
self.camera:remove()
|
||||
love.graphics.setColor(255, 255, 255, 255)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
function SpriteSystem:process(e, dt)
|
||||
@@ -19,7 +19,7 @@ function SpriteSystem:process(e, dt)
|
||||
local alpha = e.alpha or 1
|
||||
local pos, sprite, scale, rot, offset = e.pos, e.sprite, e.scale, e.rot, e.offset
|
||||
local sx, sy, r, ox, oy = scale and scale.x or 1, scale and scale.y or 1, rot or 0, offset and offset.x or 0, offset and offset.y or 0
|
||||
love.graphics.setColor(255, 255, 255, math.max(0, math.min(1, alpha)) * 255)
|
||||
love.graphics.setColor(1, 1, 1, math.max(0, math.min(1, alpha)))
|
||||
if an then
|
||||
an.flippedH = e.flippedH or false
|
||||
an.flippedV = e.flippedV or false
|
||||
|
||||
Reference in New Issue
Block a user