examples/test_2: load actor list

This commit is contained in:
Kazhnuz 2019-04-07 13:43:12 +02:00
parent f9ff7ff122
commit 1d877a2eb1
2 changed files with 16 additions and 5 deletions

View file

@ -0,0 +1,12 @@
local Obj = {}
-- On charge toutes les différentes types d'acteurs
local cwd = (...):gsub('%.init$', '') .. "."
Obj.Explosion = require(cwd .. "explosion")
Obj.index = {}
Obj.index["explosion"] = Obj.Explosion
Obj.collisions = {}
return Obj

View file

@ -27,7 +27,6 @@ local TestScene = Scene:extend()
local folder = "examples/basic/test_scene2/"
local World = require "gamecore.modules.world.baseworld"
local Explosion = require "examples.basic.test_scene2.actors.explosion"
function TestScene:new()
TestScene.super.new(self)
@ -39,10 +38,10 @@ function TestScene:new()
self.i = 0
self.estImpair = false
self.world = World(self)
Explosion(self, 12, 12)
Explosion(self, 1, 78)
Explosion(self, 40, 200)
self.world = World(self, "examples.basic.test_scene2.actors")
self.world.obj.Explosion(self, 12, 12)
self.world.obj.Explosion(self, 1, 78)
self.world.obj.Explosion(self, 40, 200)
end
function TestScene:update(dt)