From cbebb16c4630ca38fe6ae1947b6e403e872f4341 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 20 Jul 2019 16:55:06 +0200 Subject: [PATCH] feat(action3D): add box objects --- examples/gameplay/action3D/actors/box.lua | 10 ++++++++++ examples/gameplay/action3D/actors/init.lua | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 examples/gameplay/action3D/actors/box.lua 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")