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
 from intelligine.core.exceptions import NoMolecule
1
 from intelligine.core.exceptions import NoMolecule
2
 from intelligine.synergy.object.ant.Ant import Ant
2
 from intelligine.synergy.object.ant.Ant import Ant
3
+from intelligine.synergy.object.ant.Egg import Egg
3
 from synergine_xyz.display.Pygame import Pygame as XyzPygame
4
 from synergine_xyz.display.Pygame import Pygame as XyzPygame
4
 import pygame
5
 import pygame
5
 from intelligine.cst import PHEROMON_DIR_EXPLO, MOLECULES, SMELL_EGG, SMELL_FOOD, MOLECULES_DIRECTION, \
6
 from intelligine.cst import PHEROMON_DIR_EXPLO, MOLECULES, SMELL_EGG, SMELL_FOOD, MOLECULES_DIRECTION, \
103
                     self._screen.blit(label2, real_point)
104
                     self._screen.blit(label2, real_point)
104
 
105
 
105
             self._draw_callbacks.append(lambda: print_mem(ant_mem) )
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
     def start_of_cycle(self):
113
     def start_of_cycle(self):
108
         super().start_of_cycle()
114
         super().start_of_cycle()