DebugView can now render lines of text. Added DebugBox2D to show the
DebugView can now render lines of text. Added DebugBox2D to show the
number of Box2D bodies being used.

file:a/game.py -> file:b/game.py
--- a/game.py
+++ b/game.py
@@ -39,6 +39,7 @@
         # Initialize the game system
         self.debugOverlay=GObjDebugOverlay(self)
         self.debugFPS=DebugFPS(self.debugOverlay,self)
+        self.debugBox2D=DebugBox2D(self.debugOverlay,self)
 
     def run(self):
         velocityIterations=6
@@ -246,13 +247,32 @@
     def draw(self,screen):
         pass
 
+    def render_line(self,screen,text,line_number):
+        img=GObjDebugOverlay.font.render(text,True,GObjDebugOverlay.font_color)
+        screen.blit(img,(0,line_number*GObjDebugOverlay.letter_height))
+
+
 
 class DebugFPS(DebugView):
     def __init__(self,overlay,game):
         super(DebugFPS,self).__init__(overlay,game,(100,GObjDebugOverlay.letter_height))
     def draw(self,screen):
-        img=GObjDebugOverlay.font.render('FPS: %d'%self.game.clock.get_fps(),True,GObjDebugOverlay.font_color)
-        screen.blit(img,(0,0))
+        self.render_line(screen,'FPS: %d'%self.game.clock.get_fps(),0)
+
+class DebugBox2D(DebugView):
+    def __init__(self,overlay,game):
+        super(DebugBox2D,self).__init__(overlay,game,(100,3*GObjDebugOverlay.letter_height))
+    def draw(self,screen):
+        active=0
+        bodies=self.game.world.bodyCount
+        for body in self.game.world.bodies:
+            if body.active:
+                active+=1
+        sleeping=bodies-active
+
+        self.render_line(screen,'Bodies: %d'%bodies,0)
+        self.render_line(screen,'Active: %d'%active,1)
+        self.render_line(screen,'Sleeping: %d'%sleeping,2)
 
 
 class EventListener(object):