Pass read-only world proxy to scene functions. Changes ideally made only through...
[koperkapel.git] / koperkapel / scenes / base.py
index aa30be492baa518327975e8d5a96377dc88e3935..19ba212fce407eb91047652b5a114ceed719284c 100644 (file)
@@ -29,9 +29,9 @@ class Engine:
             ev.apply(self)
 
     def change_scene(self, scene):
-        self._apply_events(self._scene.exit(self._world))
+        self._apply_events(self._scene.exit(self._world.proxy()))
         self._scene = scene
-        self._apply_events(self._scene.enter(self._world))
+        self._apply_events(self._scene.enter(self._world.proxy()))
 
     def change_world(self, *args, **kw):
         self._world.apply_event(*args, **kw)
@@ -46,7 +46,7 @@ class Engine:
 
     @apply_events
     def update(self, dt):
-        return self._scene.update(self._world, dt)
+        return self._scene.update(self._world.proxy(), dt)
 
     def draw(self):
         self._scene.draw(self._app.screen, self._viewport)