Changeset 51:8efb35009ba0


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

Switch to dirty sprites and layered dirty rendering groups in the hopes that it will provide access to speed-ups later on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/physics.py

    r50 r51  
    99
    1010
    11 class Sprite(pygame.sprite.Sprite):
     11class Sprite(pygame.sprite.DirtySprite):
    1212
    1313    mobile = True # whether the velocity may be non-zero
     
    2222        self.image = pygame.Surface((10, 10))
    2323        self.image.fill((0, 0, 200))
     24        self.visible = 1
     25        self.dirty = 1
     26        self.blendmode = 0
    2427
    2528    def deltav(self, dv):
     
    4447
    4548    def __init__(self):
    46         self._all = pygame.sprite.Group()
     49        self._all = pygame.sprite.LayeredDirty()
    4750        self._mobiles = pygame.sprite.Group()
    4851        self._gravitators = pygame.sprite.Group()
Note: See TracChangeset for help on using the changeset viewer.