Browse Source

fix mistake in smell and pheromon display

Bastien Sevajol 9 years ago
parent
commit
4c51c9688d
1 changed files with 12 additions and 2 deletions
  1. 12 2
      intelligine/display/Pygame.py

+ 12 - 2
intelligine/display/Pygame.py View File

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