fpv/source/dangerSprite.lua

27 lines
514 B
Lua
Raw Normal View History

2024-05-31 13:19:42 +03:00
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