example/plateform: add coin object

This commit is contained in:
Kazhnuz 2019-05-05 15:35:49 +02:00
parent b41680fc8d
commit e4b39a318e
2 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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")