2019-02-03 20:20:01 +01:00
|
|
|
local folder = "scenes.subgame.sonicboost.actors."
|
2019-02-03 20:10:35 +01:00
|
|
|
|
|
|
|
local Entity = require(folder .. "parent")
|
2019-02-03 19:54:02 +01:00
|
|
|
local Ring = Entity:extend()
|
|
|
|
|
|
|
|
function Ring:new(world, x, y, z)
|
|
|
|
local z = z or 8
|
|
|
|
Ring.super.new(self, world, "collectible", x-8, y-8, z, 16, 16, 16)
|
|
|
|
|
|
|
|
self:setSprite("ring", 8, 16, true)
|
|
|
|
|
|
|
|
self:setDebugColor(255, 255, 0)
|
|
|
|
|
|
|
|
self.depth = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
function Ring:pickedUp(player)
|
|
|
|
player.rings = player.rings + 1
|
|
|
|
player:addScore(10)
|
|
|
|
|
|
|
|
self:destroy()
|
|
|
|
end
|
|
|
|
|
|
|
|
return Ring
|