| |
- basesprites.Bullet(basesprites.Harmful)
-
- PlayerBullet
- basesprites.Enemy(basesprites.Creature, basesprites.Harmful)
-
- Scary
- basesprites.Exit(basesprites.Sprite)
-
- NormalExit
- basesprites.Fire(basesprites.Harmful)
-
- SimpleFire
- basesprites.Player(basesprites.Creature, basesprites.Shooting)
-
- Brian
- basesprites.Powerup(basesprites.Sprite)
-
- Bear
- Lolly
- basesprites.Wall(basesprites.Sprite)
-
- SimpleWall
class Bear(basesprites.Powerup) |
| |
- Method resolution order:
- Bear
- basesprites.Powerup
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- ammo = 2
- points = 250
Methods inherited from basesprites.Powerup:
- allowcollision(self, sprite)
- oncollide(self, other)
- Handle collision with sprite.
Data and other attributes inherited from basesprites.Powerup:
- allgroups = (<Group(0 sprites)>,)
- persistant = True
- priority = 70
- required = ['points', 'ammo']
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __init__(self, level, startpos, *args)
- Initializes Sprite class.
The first argument should be a Level instance. Usually, this is done
by Level.addsprite, and this method doesn't need to be called directly.
The second argument is the starting position.
All arguments from the third argument upwards are sprite specific
arguments, like their size or their path. This should be documented
in their respective docstrings.
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- update(self)
- Updates the sprite for internal usage. Should be called once
per frame. This is done by groups.ControlledGroup.update
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class Brian(basesprites.Player) |
| |
- Method resolution order:
- Brian
- basesprites.Player
- basesprites.Creature
- basesprites.Shooting
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- getbullet(self)
- setimage(self)
Data and other attributes defined here:
- ammo = 10
- canshoot = True
- lives = 1
- mass = 10
- power = 230
- score = 0
- size = (50, 50)
- speed = [9, 11]
Methods inherited from basesprites.Player:
- __cmp__(self, other)
- allowcollision(self, spr)
- control(self, keys)
- Called by groups.ControlledGroup.
- oncollide(self, item)
- Handles collision with item.
- takelive(self)
- update(self)
Data and other attributes inherited from basesprites.Player:
- allgroups = (<GroupSingle(0 sprites)>,)
- changes = True
- level_completed = False
- living = True
- path = <Path.Path object>
- priority = 30
- required = ['score']
Methods inherited from basesprites.Creature:
- __init__(self, *args)
- adjustmove(self, speed)
- adjustmove(speed) --> (speed, walls)
Returns a tuple of the true offset moved and the walls
which prevent it from moving the amount ordered. The true offset
moved is also influenced by the speed, which is an instance
attribute (speed).
- move(self, dir)
- Move according to given direction. Called by .control().
- setplatform(self)
- Sets the platform attribute.
- shouldfall(self)
- Tells whether sprite should fall.
- standon(self, wall)
Data and other attributes inherited from basesprites.Creature:
- dir = [0, 0]
- persistant = True
- platform = None
- prevdir = [0, 0]
Methods inherited from basesprites.Shooting:
- shoot(self, direction)
- Shoots getbullet() in direction (self.speed if omitted).
Data and other attributes inherited from basesprites.Shooting:
- shootframe = -2147483647
Methods inherited from basesprites.Sprite:
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class Lolly(basesprites.Powerup) |
| |
- Method resolution order:
- Lolly
- basesprites.Powerup
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- ammo = 2
- points = 100
Methods inherited from basesprites.Powerup:
- allowcollision(self, sprite)
- oncollide(self, other)
- Handle collision with sprite.
Data and other attributes inherited from basesprites.Powerup:
- allgroups = (<Group(0 sprites)>,)
- persistant = True
- priority = 70
- required = ['points', 'ammo']
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __init__(self, level, startpos, *args)
- Initializes Sprite class.
The first argument should be a Level instance. Usually, this is done
by Level.addsprite, and this method doesn't need to be called directly.
The second argument is the starting position.
All arguments from the third argument upwards are sprite specific
arguments, like their size or their path. This should be documented
in their respective docstrings.
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- update(self)
- Updates the sprite for internal usage. Should be called once
per frame. This is done by groups.ControlledGroup.update
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class NormalExit(basesprites.Exit) |
| |
- Method resolution order:
- NormalExit
- basesprites.Exit
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- oncollide(self, other)
- setimage(self)
Data and other attributes defined here:
- offset = (5, 5, 5, 5)
Methods inherited from basesprites.Exit:
- allowcollision(self, sprite)
Data and other attributes inherited from basesprites.Exit:
- allgroups = (<Group(0 sprites)>,)
- persistant = True
- priority = 20
- required = []
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __init__(self, level, startpos, *args)
- Initializes Sprite class.
The first argument should be a Level instance. Usually, this is done
by Level.addsprite, and this method doesn't need to be called directly.
The second argument is the starting position.
All arguments from the third argument upwards are sprite specific
arguments, like their size or their path. This should be documented
in their respective docstrings.
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- update(self)
- Updates the sprite for internal usage. Should be called once
per frame. This is done by groups.ControlledGroup.update
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class PlayerBullet(basesprites.Bullet) |
| |
- Method resolution order:
- PlayerBullet
- basesprites.Bullet
- basesprites.Harmful
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- lifetime = 50
- reloadtime = 10
- speed = [30, 30]
Methods inherited from basesprites.Bullet:
- __init__(self, *args)
- allowcollision(self, sprite)
- expired(self)
- Returns True if the bullet has been expired.
- oncollide(self, other)
- Handle collision with sprite.
- update(self)
Data and other attributes inherited from basesprites.Bullet:
- allgroups = (<Group(0 sprites)>,)
- changes = True
- persistant = False
- priority = 10
- required = ['speed', 'lifetime', 'reloadtime']
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class Scary(basesprites.Enemy) |
| |
- Method resolution order:
- Scary
- basesprites.Enemy
- basesprites.Creature
- basesprites.Harmful
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- ammo = 0
- canshoot = False
- lives = 2
- mass = 5
- power = 200
- speed = [5, 5]
- turnchance = 0.050000000000000003
Methods inherited from basesprites.Enemy:
- __init__(self, *args)
- allowcollision(self, sprite)
- turn(self)
- update(self)
Data and other attributes inherited from basesprites.Enemy:
- allgroups = (<Group(0 sprites)>,)
- changes = True
- priority = 50
- required = ['turnchance']
Methods inherited from basesprites.Creature:
- adjustmove(self, speed)
- adjustmove(speed) --> (speed, walls)
Returns a tuple of the true offset moved and the walls
which prevent it from moving the amount ordered. The true offset
moved is also influenced by the speed, which is an instance
attribute (speed).
- move(self, dir)
- Move according to given direction. Called by .control().
- oncollide(self, item)
- setplatform(self)
- Sets the platform attribute.
- shouldfall(self)
- Tells whether sprite should fall.
- standon(self, wall)
- takelive(self)
Data and other attributes inherited from basesprites.Creature:
- dir = [0, 0]
- persistant = True
- platform = None
- prevdir = [0, 0]
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- varsize = False
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class SimpleFire(basesprites.Fire) |
| |
- Method resolution order:
- SimpleFire
- basesprites.Fire
- basesprites.Harmful
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- varsize = True
Methods inherited from basesprites.Fire:
- __init__(self, level, startpos, size)
- allowcollision(self, sprite)
- oncollide(self, other)
Data and other attributes inherited from basesprites.Fire:
- persistant = True
- priority = 40
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- update(self)
- Updates the sprite for internal usage. Should be called once
per frame. This is done by groups.ControlledGroup.update
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- allgroups = (<ControlledGroup(0 sprites)>,)
- collisions = Set([])
- lastbehind = False
- offset = (0, 0, 0, 0)
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- required = ['setimage', 'allgroups', 'required', 'oncollide', 'persistant', 'priority']
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
|
class SimpleWall(basesprites.Wall) |
| |
- Method resolution order:
- SimpleWall
- basesprites.Wall
- basesprites.Sprite
- pygame.sprite.Sprite
- __builtin__.object
Methods defined here:
- setimage(self)
Data and other attributes defined here:
- offset = (10, 15, 0, 15)
Methods inherited from basesprites.Wall:
- __init__(self, level, startpos, size)
- oncollide(self, other)
Data and other attributes inherited from basesprites.Wall:
- allgroups = (<Group(0 sprites)>,)
- persistant = True
- priority = 100
- varsize = True
Methods inherited from basesprites.Sprite:
- __cmp__(self, other)
- Drawn in this order
- __getstate__(self)
- Alters the __dict__ so it can be Pickled
- __repr__(self)
- __setstate__(self, arg)
- Reverse of __getstate__
- allowcollision(self, sprite)
- Returns True if a collision with sprite shouldn't have consequences.
Base classes may override this method, but should make sure
the parent .allowcollision() is called.
- behindwall(self)
- True if this sprite is behind a wall
- collideswith(self)
- Returns a set of all objects this sprite collides with.
- docollisions(self)
- Posts events for all collisions and return information for redrawing.
- kill(self)
- Kills the sprite and removes the sprite from level.
- setrects(self, pos)
- Initializes outerrect and innerrect.
This method must be called after setimage
- update(self)
- Updates the sprite for internal usage. Should be called once
per frame. This is done by groups.ControlledGroup.update
- updatepg(self)
- Update PlacedGroup memberships if necessary.
Properties inherited from basesprites.Sprite:
- image
- Return the correct image.
If self._image is a Surface, it is returned.
If it is an instance of ImageServer, the correct image is searched.
This finds place according to the following rules:
The direction are checked in the following order: first, the
current direction. Then, if applicable, the components of the
current direction. Then the centered direction. Then the previous
direction and its components. Finally, all other directions are
checked from NW to SE.
If this is the first frame of dir, and im.<dir>[0][0] exists, it
is returned. If 0 <= fm < len(im.<dir>[1]) (1 if im.<dir>[0][0]
exists) the appropiate frame is shown (im.<dir>[1][fm]). If fm >
len(im.<dir>[1]), and im.<dir>[2][0] exists, im.<dir>[2][0] is
returned. If im.<dir>[2][0] does not exist,
im.<dir>[fm % len(im.<dir>[1])] is shown.
Note: all items beyond the first of im.<dir>[0 or 2] are ignored.
- get = get(self)
- set = set(self, im)
- delete = del_(self)
- info
- All groups a sprite is member of and required attributes.
- get = get(self)
Data and other attributes inherited from basesprites.Sprite:
- collisions = Set([])
- lastbehind = False
- pgrects = []
- pgs = []
- pgtotalrect = <rect(0, 0, 0, 0)>
- required = ['setimage', 'allgroups', 'required', 'oncollide', 'persistant', 'priority']
Methods inherited from pygame.sprite.Sprite:
- add(self, group)
- add(group)
add a sprite to container
Add the sprite to a group or sequence of groups.
- add_internal(self, group)
- alive(self)
- alive() -> bool
ask the life of a sprite
Returns true if this sprite is a member of any groups.
- groups(self)
- groups() -> list
list used sprite containers
Returns a list of all the groups that contain this
sprite.
- remove(self, group)
- remove(group)
remove a sprite from container
Remove the sprite from a group or sequence of groups.
- remove_internal(self, group)
Data and other attributes inherited from pygame.sprite.Sprite:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Sprite' objects>
- list of weak references to the object (if defined)
| |