diff --git a/examples/gameplay/action3D/actors/box.lua b/examples/gameplay/action3D/actors/box.lua new file mode 100644 index 0000000..bfe15d6 --- /dev/null +++ b/examples/gameplay/action3D/actors/box.lua @@ -0,0 +1,10 @@ +local Base = require "gamecore.modules.world.actors.actor3D" +local Box = Base:extend() + +function Box:new(world, x, y, z) + Box.super.new(self, world, "box", x, y, z, 16, 16, 16, true) + self:setDebugColor(0,0,0) + self.boxes.Textured(self, 16, 16, 16, "boxtop", "box") +end + +return Box diff --git a/examples/gameplay/action3D/actors/init.lua b/examples/gameplay/action3D/actors/init.lua index 9d67a55..78d243c 100644 --- a/examples/gameplay/action3D/actors/init.lua +++ b/examples/gameplay/action3D/actors/init.lua @@ -2,10 +2,12 @@ local Obj = {} -- On charge toutes les différentes types d'acteurs local cwd = (...):gsub('%.init$', '') .. "." -Obj.Player = require(cwd .. "player") +Obj.Player = require(cwd .. "player") +Obj.Box = require(cwd .. "box") Obj.index = {} Obj.index["player"] = Obj.Player +Obj.index["box"] = Obj.Box Obj.collisions = {} Obj.collisions["wall"] = require(cwd .. "wall")