Changeset 53:01cfef3a5acf


Ignore:
Timestamp:
Apr 3, 2011, 7:32:04 PM (9 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Message:

Add debugging rectangles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/physics.py

    r51 r53  
    55
    66import pygame.sprite
     7import pygame.draw
    78import pygame
    89import time
    9 
     10from constants import DEBUG
    1011
    1112class Sprite(pygame.sprite.DirtySprite):
     
    2526        self.dirty = 1
    2627        self.blendmode = 0
     28
     29    def draw_debug(self, surface):
     30        pygame.draw.rect(surface, (240, 0, 0), self.rect, 1)
    2731
    2832    def deltav(self, dv):
     
    8892    def draw(self, surface):
    8993        self._all.draw(surface)
     94        if DEBUG:
     95            for sprite in self._all:
     96                sprite.draw_debug(surface)
Note: See TracChangeset for help on using the changeset viewer.