local Loot = require "scenes.levels.entities.loot.parent" local Coin = Loot:extend() function Coin:new(level, x, y, anim, value) self.value = value or 1 local anim = anim or "coin" Coin.super.new(self, level, x, y, anim) end function Coin:takeLoot() self.obj.GFX(self.scene, self.x+8, self.y+8, "sparkle", 1) self:destroy() self.scene.playermanager.gold = self.scene.playermanager.gold + self.value self.scene.playermanager.score = self.scene.playermanager.score + 10 self.scene.assets:playSFX("collectcoin") end return Coin