Ignore:
Timestamp:
Apr 3, 2011, 4:02:41 PM (10 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Message:

Very start of world / physics engine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/physics.py

    r22 r23  
    1414
    1515class World(object):
    16     pass
     16
     17    def __init__(self):
     18        self._all = pygame.sprite.Group()
     19        self._mobiles = pygame.sprite.Group()
     20        self._gravitators = pygame.sprite.Group()
     21
     22    def add(self, sprite):
     23        self._all.add(sprite)
     24        if sprite.mobile:
     25            self._mobiles.add(sprite)
     26        if sprite.gravitates:
     27            self._gravitators.add(sprite)
Note: See TracChangeset for help on using the changeset viewer.