diff --git a/examples/gameplay/plateform/actors/coin.lua b/examples/gameplay/plateform/actors/coin.lua new file mode 100644 index 0000000..a4bdaa2 --- /dev/null +++ b/examples/gameplay/plateform/actors/coin.lua @@ -0,0 +1,9 @@ +local Base = require "gamecore.modules.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 + +return Coin diff --git a/examples/gameplay/plateform/actors/init.lua b/examples/gameplay/plateform/actors/init.lua index 8a009b1..ed7164a 100644 --- a/examples/gameplay/plateform/actors/init.lua +++ b/examples/gameplay/plateform/actors/init.lua @@ -7,6 +7,7 @@ Obj.Player = require(cwd .. "player") Obj.index = {} Obj.index["player"] = require(cwd .. "player") +Obj.index["coin"] = require(cwd .. "coin") Obj.collisions = {} Obj.collisions["wall"] = require(cwd .. "wall")