epervier-framework/examples/scenes/gameplay/plateform/actors/coin.lua
Kazhnuz 4b088dac87 improvement(assets): global asset system
Remove the old scene-bound asset system and replace it with a global one. Can lazyload but doesn't do it for the moment.

Fixes #70
!BREAKING
2024-10-28 17:19:29 +01:00

15 lines
381 B
Lua

local Base = require "framework.scenes.world.actors.actor2D"
local Coin = Base:extend()
function Coin:new(world, x, y)
Coin.super.new(self, world, "coin", x, y, 16, 16, false)
self:setSprite("coin")
end
function Coin:takeCoin(other)
self.obj.GFX(self.world, self.x + 8, self.y + 8, "gfx.sparkle")
assets:playSFX("gameplay.collectcoin")
self:destroy( )
end
return Coin