Compare commits
No commits in common. "bae7e4f4240ce6b743c864c89c2ec7434887eff8" and "3b83851fb9f97b2803a3be6a3984349d06f9cbc4" have entirely different histories.
bae7e4f424
...
3b83851fb9
2 changed files with 3 additions and 23 deletions
21
main.lua
21
main.lua
|
|
@ -31,12 +31,9 @@ Area = require 'obj/Area'
|
|||
GameObject = require 'obj/GameObject'
|
||||
|
||||
function love.load()
|
||||
-- dt * slow_amnt
|
||||
-- slowmo var
|
||||
slow_amnt = 1
|
||||
|
||||
-- flash frames
|
||||
flash_frames = nil
|
||||
|
||||
-- global timer
|
||||
timer = Timer()
|
||||
|
||||
|
|
@ -129,16 +126,6 @@ end
|
|||
|
||||
function love.draw()
|
||||
if current_room then current_room:draw() end
|
||||
|
||||
if flash_frames then
|
||||
flash_frames = flash_frames - 1
|
||||
if flash_frames == -1 then flash_frames = nil end
|
||||
end
|
||||
if flash_frames then
|
||||
love.graphics.setColor(COLORS.bg)
|
||||
love.graphics.rectangle('fill', 0, 0, sx*gw, sy*gh)
|
||||
love.graphics.setColor(COLORS.default)
|
||||
end
|
||||
end
|
||||
|
||||
---Enumerates files in a folder and inserts them to a provided table.
|
||||
|
|
@ -197,12 +184,6 @@ function slow(amount, duration)
|
|||
timer:tween(duration, _G, {slow_amnt = 1}, 'in-out-cubic')
|
||||
end
|
||||
|
||||
---Flashes the screen for a set amount of frames
|
||||
---@param frames number
|
||||
function flash(frames)
|
||||
flash_frames = frames
|
||||
end
|
||||
|
||||
---Generates and returns random UUID string
|
||||
---@return string
|
||||
function UUID()
|
||||
|
|
|
|||
|
|
@ -84,12 +84,11 @@ end
|
|||
|
||||
function Player:kill()
|
||||
self:destroy()
|
||||
flash(4)
|
||||
camera:shake(6, 60, .4)
|
||||
slow(.15, 1)
|
||||
for i=1, random(8,12) do
|
||||
self.area:addGameObject('ExplodeParticle', self.x, self.y)
|
||||
end
|
||||
slow(.15, 1)
|
||||
camera:shake(6, 60, .4)
|
||||
end
|
||||
|
||||
return Player
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue