examples/test_2: load actor list
This commit is contained in:
parent
f9ff7ff122
commit
1d877a2eb1
2 changed files with 16 additions and 5 deletions
12
examples/basic/test_scene2/actors/init.lua
Normal file
12
examples/basic/test_scene2/actors/init.lua
Normal 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
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue