seat_actor.pos = (
seat.vehicle_pos[0] + VEHICLE_MID_X,
seat.vehicle_pos[1] + VEHICLE_MID_Y)
+ self._seat_layer[self._seat_pos].selected = True
def _init_roaches(self, world):
self._roach_actors = {}
def _inventory_right(self):
self._inventory_pos += 1
+ def _select_seat(self, seat_pos):
+ self._seat_layer[self._seat_pos].selected = False
+ self._seat_pos = seat_pos
+ self._seat_layer[self._seat_pos].selected = True
+
def _eject_roach(self):
print("Eject roach.")
- def update(self, world, dt):
+ def update(self, world, engine, dt):
self._update_inventory(world)
self._update_roaches(world)
if button == mouse.LEFT:
for actor in self.actors.buttons:
if actor.collidepoint(pos):
- actor.action()
- break
+ return actor.action()
+ for i, actor in enumerate(self.actors.seats):
+ if actor.collidepoint(pos):
+ return self._select_seat(i)