This commit is contained in:
2025-04-11 15:15:19 +02:00
parent 95b2c825db
commit 648e4a3dc4
7 changed files with 167 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
Granade = {}
class('Granade').extends(NobleSprite)
function Granade:init(x, y)
Granade.super.init(self)
self.initialRadius = 10
self.currentRadius = self.initialRadius
self.shrinkRate = 0.2
self.isActive = true
self:moveTo(x, y)
print("Granade init")
print(self.x, self.y)
end
function Granade:update()
if self.isActive then
self.currentRadius = self.currentRadius - self.shrinkRate
if self.currentRadius <= 0 then
print("Granade deactivated")
self.isActive = false
self:remove()
end
end
self:draw()
end
function Granade:draw()
playdate.graphics.fillCircleAtPoint(self.x, self.y, self.currentRadius)
end