From 5e95099af971bc34f520acad5710d8741d5e8090 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 6 May 2019 20:45:13 +0200 Subject: [PATCH] examples/plateform: make coin drop sparkle gfx when taken --- examples/gameplay/plateform/actors/coin.lua | 1 + examples/gameplay/plateform/actors/init.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/gameplay/plateform/actors/coin.lua b/examples/gameplay/plateform/actors/coin.lua index 4e718e2..e3364f5 100644 --- a/examples/gameplay/plateform/actors/coin.lua +++ b/examples/gameplay/plateform/actors/coin.lua @@ -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 diff --git a/examples/gameplay/plateform/actors/init.lua b/examples/gameplay/plateform/actors/init.lua index ed7164a..0c9ed5e 100644 --- a/examples/gameplay/plateform/actors/init.lua +++ b/examples/gameplay/plateform/actors/init.lua @@ -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")