27 lines
514 B
Lua
27 lines
514 B
Lua
|
local pd <const> = playdate
|
||
|
local gfx <const> = playdate.graphics
|
||
|
|
||
|
class("Danger").extends(AnimatedSprite)
|
||
|
|
||
|
function Danger:init(x, y, baleba)
|
||
|
local dangerImageTable = gfx.imagetable.new("sprites/danger")
|
||
|
Danger.super.init(self, dangerImageTable)
|
||
|
|
||
|
self:moveTo(x, y)
|
||
|
|
||
|
self:addState("run", 1,5, {tickStep = 2})
|
||
|
|
||
|
self:setDefaultState("run")
|
||
|
|
||
|
self:playAnimation()
|
||
|
|
||
|
self:setZIndex(11)
|
||
|
|
||
|
self:setTag(7)
|
||
|
|
||
|
self.baleba = baleba
|
||
|
end
|
||
|
|
||
|
function Danger:update()
|
||
|
self:updateAnimation()
|
||
|
end
|