Pass read-only world proxy to scene functions. Changes ideally made only through...
[koperkapel.git] / koperkapel / scenes / roaches.py
index aab4a9a2be480a310f5e820a8abf2beb77f705bd..74f32a96f3344acacddb3406633e9cce62edbaab 100644 (file)
@@ -14,15 +14,15 @@ class RoachesScene(Scene):
 
     def update(self, world, dt):
         for i, roach in enumerate(world.roaches):
-            if roach["name"] in self._roach_actors:
-                actor = self._roach_actors[roach["name"]]
+            if roach.name in self._roach_actors:
+                actor = self._roach_actors[roach.name]
             else:
                 actor = TextButton("%s [%s]" % (
-                    roach["name"],
+                    roach.name,
                     ", ".join("%s=%s" % kv for kv in sorted(
-                        roach["attributes"].items()),
+                        roach.attributes.items()),
                     )))
-                self._roach_actors[roach["name"]] = actor
+                self._roach_actors[roach.name] = actor
                 self.actors.add(actor)
             # TODO: remove missing roaches
             actor.pos = (300, 100 + i * 100)