Add code for repeating waves of enemies, adding intro animations so the enemies can 'fly in', and refactor entity to use a state machine system for more flexibility.

This commit is contained in:
Anna Rose Wiggins 2023-10-03 16:16:19 -04:00
parent 2a2b106df0
commit 001ed4cfa4
8 changed files with 253 additions and 49 deletions

View file

@ -42,6 +42,7 @@ class("Kani").extends(Entity)
function Kani:init(ui)
Kani.super.init(self, gfx.image.new("images/kani.png"), 100)
self.type = 'kani'
self:setGroupMask(0x2)
self:setCollidesWithGroupsMask(0xd)
@ -76,6 +77,8 @@ function Kani:init(ui)
end,
AButtonUp = function() self:fire() end,
}
self.fsm:changeState("READY")
end
function Kani:chargeReserve(change)
@ -141,8 +144,8 @@ function Kani:removeInputHandlers()
end
-- move that crab!
function Kani:update()
local collisions = Kani.super.update(self)
function Kani:runReady()
local collisions = Kani.super.runReady(self)
for i=0, #collisions, 1 do
-- handle player-triggered collisions
end