Changeset 117:b361d9e17c26


Ignore:
Timestamp:
Apr 4, 2011, 8:02:52 PM (9 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Message:

Angry fruit salad debug boxes.

Location:
skaapsteker
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/physics.py

    r116 r117  
    3131    wants_updates = False
    3232
     33    debug_color = (240, 0, 0)
     34
    3335    def __init__(self, *args, **kwargs):
    3436        super(Sprite, self).__init__(*args, **kwargs)
     
    4446        self._float_pos = self.rect.topleft
    4547
     48    def get_debug_color(self):
     49        return self.debug_color
     50
    4651    def draw_debug(self, surface):
    47         pygame.draw.rect(surface, (240, 0, 0), self.rect, 1)
     52        pygame.draw.rect(surface, self.get_debug_color(), self.rect, 1)
    4853
    4954    def deltav(self, dv):
  • skaapsteker/sprites/base.py

    r97 r117  
    2020    collision_layer = MONSTER_LAYER
    2121    collides_with = set([PC_LAYER])
     22
     23    debug_color = (240, 120, 120)
    2224
    2325    def __init__(self, pos, **opts):
     
    5860        self.rect = Rect((pos[0] * TILE_SIZE[0], pos[1] * TILE_SIZE[1]), TILE_SIZE)
    5961
     62    def get_debug_color(self):
     63        if self.floor or self.block:
     64            return (240, 240, 0)
     65        return (0, 240, 0)
     66
    6067
    6168def find_sprite(descr):
Note: See TracChangeset for help on using the changeset viewer.