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 Explosion = Parent:extend()
|
||||
|
||||
function Explosion:new(scene, x, y)
|
||||
Explosion.super.new(self, scene, "explosion", x - 8, y - 8, 16, 16)
|
||||
function Explosion:new(world, x, y)
|
||||
Explosion.super.new(self, world, "explosion", x - 8, y - 8, 16, 16)
|
||||
end
|
||||
|
||||
return Explosion
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local Base = require "gamecore.modules.world.actors.actor2D"
|
||||
local Parent = Base:extend()
|
||||
|
||||
function Parent:new(scene, type, x, y, w, h)
|
||||
self.scene = scene
|
||||
Parent.super.new(self, scene.world, type, x, y, w, h)
|
||||
function Parent:new(world, type, x, y, w, h)
|
||||
self.scene = world.scene
|
||||
Parent.super.new(self, world, type, x, y, w, h)
|
||||
end
|
||||
|
||||
function Parent:update(dt)
|
||||
|
|
|
@ -39,9 +39,9 @@ function TestScene:new()
|
|||
self.estImpair = false
|
||||
|
||||
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)
|
||||
self.world.obj.Explosion(self.world, 12, 12)
|
||||
self.world.obj.Explosion(self.world, 1, 78)
|
||||
self.world.obj.Explosion(self.world, 40, 200)
|
||||
end
|
||||
|
||||
function TestScene:update(dt)
|
||||
|
|
Loading…
Reference in a new issue