Explorar el Código

fix mistake in smell and pheromon display

Bastien Sevajol hace 9 años
padre
commit
4c51c9688d
Se han modificado 1 ficheros con 12 adiciones y 2 borrados
  1. 12 2
      intelligine/display/Pygame.py

+ 12 - 2
intelligine/display/Pygame.py Ver fichero

@@ -59,5 +59,15 @@ class Pygame(XyzPygame):
59 59
                 self.draw_surface(point, smell_food_surface)
60 60
 
61 61
     def _key_pressed(self, key):
62
-        self._is_display_pheromones = key == pygame.K_p
63
-        self._is_display_smells = key == pygame.K_s
62
+
63
+        if key == pygame.K_p:
64
+            if self._is_display_pheromones:
65
+                self._is_display_pheromones = False
66
+            else:
67
+                self._is_display_pheromones = True
68
+
69
+        if key == pygame.K_s:
70
+            if self._is_display_smells:
71
+                self._is_display_smells = False
72
+            else:
73
+                self._is_display_smells = True