examples/moveplayer: add walls

This commit is contained in:
Kazhnuz 2019-05-01 17:20:31 +02:00
parent dd21878ee8
commit 40daa66eeb
2 changed files with 16 additions and 1 deletions

View file

@ -5,8 +5,9 @@ local cwd = (...):gsub('%.init$', '') .. "."
Obj.Player = require(cwd .. "player") Obj.Player = require(cwd .. "player")
Obj.index = {} Obj.index = {}
Obj.index["player"] = Obj.Explosion Obj.index["player"] = Obj.Player
Obj.collisions = {} Obj.collisions = {}
Obj.collisions["wall"] = require(cwd .. "wall")
return Obj return Obj

View file

@ -0,0 +1,14 @@
local Base = require "gamecore.modules.world.actors.actor2D"
local Wall = Base:extend()
function Wall:new(world, x, y, w, h)
Wall.super.new(self, world, "wall", x, y, w, h, true)
self:setDebugColor(0,0,0)
end
function Wall:draw()
self:drawHitbox()
utils.graphics.resetColor( )
end
return Wall