examples/test_2: always load from world and not from scene
This commit is contained in:
parent
63238c4ec6
commit
856d41beb5
3 changed files with 8 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
||||||
local Parent = require "examples.basic.test_scene2.actors.parent"
|
local Parent = require "examples.basic.test_scene2.actors.parent"
|
||||||
local Explosion = Parent:extend()
|
local Explosion = Parent:extend()
|
||||||
|
|
||||||
function Explosion:new(scene, x, y)
|
function Explosion:new(world, x, y)
|
||||||
Explosion.super.new(self, scene, "explosion", x - 8, y - 8, 16, 16)
|
Explosion.super.new(self, world, "explosion", x - 8, y - 8, 16, 16)
|
||||||
end
|
end
|
||||||
|
|
||||||
return Explosion
|
return Explosion
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
local Base = require "gamecore.modules.world.actors.actor2D"
|
local Base = require "gamecore.modules.world.actors.actor2D"
|
||||||
local Parent = Base:extend()
|
local Parent = Base:extend()
|
||||||
|
|
||||||
function Parent:new(scene, type, x, y, w, h)
|
function Parent:new(world, type, x, y, w, h)
|
||||||
self.scene = scene
|
self.scene = world.scene
|
||||||
Parent.super.new(self, scene.world, type, x, y, w, h)
|
Parent.super.new(self, world, type, x, y, w, h)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Parent:update(dt)
|
function Parent:update(dt)
|
||||||
|
|
|
@ -39,9 +39,9 @@ function TestScene:new()
|
||||||
self.estImpair = false
|
self.estImpair = false
|
||||||
|
|
||||||
self.world = World(self, "examples.basic.test_scene2.actors")
|
self.world = World(self, "examples.basic.test_scene2.actors")
|
||||||
self.world.obj.Explosion(self, 12, 12)
|
self.world.obj.Explosion(self.world, 12, 12)
|
||||||
self.world.obj.Explosion(self, 1, 78)
|
self.world.obj.Explosion(self.world, 1, 78)
|
||||||
self.world.obj.Explosion(self, 40, 200)
|
self.world.obj.Explosion(self.world, 40, 200)
|
||||||
end
|
end
|
||||||
|
|
||||||
function TestScene:update(dt)
|
function TestScene:update(dt)
|
||||||
|
|
Loading…
Reference in a new issue