fpv/source/scripts/dangerSprite.lua

24 lines
570 B
Lua
Raw Normal View History

2024-06-01 16:52:11 +03:00
Danger = {}
class("Danger").extends(AnimatedSprite)
local dangerImageTable = Graphics.imagetable.new("assets/sprites/danger")
function Danger:init(x, y, dangerousObject)
Danger.super.init(self, dangerImageTable)
self.dangerousObject = dangerousObject
-- Animation properties
self:addState("run", 1,5, {tickStep = 2})
self:setDefaultState("run")
self:playAnimation()
-- Collision properties
self:setZIndex(11)
self:setTag(7)
self:moveTo(x, y)
end
function Danger:update()
self:updateAnimation()
2024-05-31 13:19:42 +03:00
end