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
function Coin:takeCoin(other)
self.obj.GFX(self.world, self.x + 8, self.y + 8, "sparkle")
self:destroy( )
end

View File

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