examples/plateform: make coin drop sparkle gfx when taken

This commit is contained in:
Kazhnuz 2019-05-06 20:45:13 +02:00
parent 3de36cc77f
commit 5e95099af9
2 changed files with 2 additions and 0 deletions

View file

@ -7,6 +7,7 @@ function Coin:new(world, x, y)
end end
function Coin:takeCoin(other) function Coin:takeCoin(other)
self.obj.GFX(self.world, self.x + 8, self.y + 8, "sparkle")
self:destroy( ) self:destroy( )
end end

View file

@ -4,6 +4,7 @@ local Obj = {}
local cwd = (...):gsub('%.init$', '') .. "." local cwd = (...):gsub('%.init$', '') .. "."
Obj.Player = require(cwd .. "player") Obj.Player = require(cwd .. "player")
Obj.GFX = require("gamecore.modules.world.actors.gfx2D")
Obj.index = {} Obj.index = {}
Obj.index["player"] = require(cwd .. "player") Obj.index["player"] = require(cwd .. "player")