Browse Source

add egg id debug display

Bastien Sevajol 8 years ago
parent
commit
fa22d9b45b
1 changed files with 6 additions and 0 deletions
  1. 6 0
      intelligine/display/Pygame.py

+ 6 - 0
intelligine/display/Pygame.py View File

@@ -1,5 +1,6 @@
1 1
 from intelligine.core.exceptions import NoMolecule
2 2
 from intelligine.synergy.object.ant.Ant import Ant
3
+from intelligine.synergy.object.ant.Egg import Egg
3 4
 from synergine_xyz.display.Pygame import Pygame as XyzPygame
4 5
 import pygame
5 6
 from intelligine.cst import PHEROMON_DIR_EXPLO, MOLECULES, SMELL_EGG, SMELL_FOOD, MOLECULES_DIRECTION, \
@@ -103,6 +104,11 @@ class Pygame(XyzPygame):
103 104
                     self._screen.blit(label2, real_point)
104 105
 
105 106
             self._draw_callbacks.append(lambda: print_mem(ant_mem) )
107
+        # TODO: DEBUG
108
+        if isinstance(obj, Egg):
109
+            myfont = pygame.font.SysFont("monospace", 15)
110
+            label = myfont.render(str(obj.get_id()), 1, (125,255,25))
111
+            self._draw_callbacks.append(lambda: self._screen.blit(label, point))
106 112
 
107 113
     def start_of_cycle(self):
108 114
         super().start_of_cycle()