fpv/source/scripts/dangerSprite.lua

22 lines
512 B
Lua
Raw Normal View History

2024-06-01 16:52:11 +03:00
Danger = {}
2024-06-02 20:25:27 +03:00
class("Danger").extends(NobleSprite)
2024-06-01 16:52:11 +03:00
function Danger:init(x, y, dangerousObject)
2024-06-02 20:25:27 +03:00
Danger.super.init(self, "assets/sprites/danger", true)
2024-06-01 16:52:11 +03:00
self.dangerousObject = dangerousObject
-- Animation properties
2024-06-02 20:25:27 +03:00
self.animation:addState("run", 1, 5)
self.animation.run.frameDuration = 2
self.animation:setState("run")
2024-06-01 16:52:11 +03:00
-- Collision properties
2024-06-03 00:31:15 +03:00
self:setZIndex(ZIndex.alert)
2024-06-01 16:52:11 +03:00
self:setTag(7)
2024-06-02 20:25:27 +03:00
self:setSize(64, 64)
2024-06-01 16:52:11 +03:00
2024-06-02 20:25:27 +03:00
self:add()
2024-06-01 16:52:11 +03:00
self:moveTo(x, y)
end