example/plateform: add coin object
This commit is contained in:
parent
b41680fc8d
commit
e4b39a318e
2 changed files with 10 additions and 0 deletions
9
examples/gameplay/plateform/actors/coin.lua
Normal file
9
examples/gameplay/plateform/actors/coin.lua
Normal 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
|
|
@ -7,6 +7,7 @@ Obj.Player = require(cwd .. "player")
|
||||||
|
|
||||||
Obj.index = {}
|
Obj.index = {}
|
||||||
Obj.index["player"] = require(cwd .. "player")
|
Obj.index["player"] = require(cwd .. "player")
|
||||||
|
Obj.index["coin"] = require(cwd .. "coin")
|
||||||
|
|
||||||
Obj.collisions = {}
|
Obj.collisions = {}
|
||||||
Obj.collisions["wall"] = require(cwd .. "wall")
|
Obj.collisions["wall"] = require(cwd .. "wall")
|
||||||
|
|
Loading…
Reference in a new issue