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:
parent
2a2b106df0
commit
001ed4cfa4
8 changed files with 253 additions and 49 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue