examples/test_2: always load from world and not from scene

This commit is contained in:
Kazhnuz 2019-04-07 13:47:37 +02:00
parent 63238c4ec6
commit 856d41beb5
3 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)