examples/moveplayer: add walls
This commit is contained in:
parent
dd21878ee8
commit
40daa66eeb
2 changed files with 16 additions and 1 deletions
|
@ -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
|
||||||
|
|
14
examples/gameplay/moveplayer/actors/wall.lua
Normal file
14
examples/gameplay/moveplayer/actors/wall.lua
Normal 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
|
Loading…
Reference in a new issue