| Home | Trees | Index | Help |
|---|
|
|
object --+
|
Body
bbox: The body's bounding box
(read-only).
solid_sides: A set of flags
indicating which sides of the body are 'solid.'
support: The body that supports
this body, or None.
support_side: The side of this body
that it's support is on.
supported_bodies: A list of the
bodies that are supported by this body.
owner: A pointer to the game entity
that owns this body.
handle_movmement
method will be called (if defined).
handle_collision method will be called (if defined).
handle_lose_support method will be called (if
defined).
| Method Summary | |
|---|---|
__init__(self,
owner,
bbox,
is_solid,
solid_sides,
is_mobile)
| |
__repr__(self)
| |
jump(self,
dx,
dy,
check_collisions)
| |
jump_to(self,
x,
y,
check_collisions)
| |
move(self,
dx,
dy,
report_collisions)
| |
move_to(self,
x,
y,
report_collisions)
| |
set_bbox(self,
bbox,
check_collisions)
| |
If this body's bounding box is adjacent to rect, then
return the side flag constant indicating the side that it is adjacent on;
otherwise, return False. | |
_check_notifications(self,
owner)
| |
_checkmobile(self,
val)
| |
_debug_check_cycles(self,
cache)
| |
Remove this body's support. | |
Set this body's support to support. | |
_set_xaccel(self,
val)
| |
_set_xvel(self,
val)
| |
_set_yaccel(self,
val)
| |
_set_yvel(self,
val)
| |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... | |
| Property Summary | |
|---|---|
bbox: A pygame Rect describing the current position of this body's bounding
box. | |
is_mobile: A flag indicating whether this is a mobile body. | |
is_solid: A flag indicating whether this body can participate in collisions. | |
owner: A pointer to the game entity that owns this body. | |
support: The body that supports this body, or None if this body is
not supported. | |
support_side: The side of this body that it's support is on. | |
supported_bodies: A list of the bodies that are supported by this body. | |
xaccel: The x acceleration of the body, in pixels/sec^2. | |
xvel: The x velocity of the body, in pixels/sec. | |
yaccel: The y acceleration of the body, in pixels/sec^2. | |
yvel: The y velocity of the body, in pixels/sec. | |
| Instance Variable Summary | |
|---|---|
NoneType |
physics_engine: A pointer to the physics engine that manages this entity (if any). |
solid_sides: A set of flags indicating which sides of the body are 'solid.' | |
_bbox: The body's bounding box. | |
_owner: A pointer to the game entity that owns this body. | |
_xaccel, _yaccel: The acceleration of the body, in pixels/sec^2. | |
_xfrac, _yfrac: A fractional offset to the bounding box, used to record movement
distances that are less than a pixel in size. | |
_xvel, _yvel: The velocity of the body, in pixels/sec. | |
| Support | |
NoneType |
_support_side: The side of this body that it's support is on. |
NoneType |
_support: The body that supports this body, or None if this body is
not supported. |
_supported_objects: A list of the bodies that are supported by this body. | |
| Motion | |
_is_mobile: Is this a mobile body? | |
int |
_delay: How long has it been since our last update? |
| Physical Event Notification | |
_notify_collision: True if the owner's handle_collision method should be called when we
collide. | |
_notify_lose_support: True if the owner's handle_lose_support method should be called when
we lose support. | |
| Class Variable Summary | |
|---|---|
| Support | |
tuple |
_supported_bodies = ()
|
| Motion | |
int |
_xvel = 0 |
int |
_yvel = 0 |
int |
_xaccel = 0 |
int |
_yaccel = 0 |
int |
_xfrac = 0 |
int |
_yfrac = 0 |
| Method Details |
|---|
__init__(self,
owner,
bbox,
is_solid,
solid_sides,
is_mobile)
|
__repr__(self)
|
jump(self, dx, dy, check_collisions=True) |
jump_to(self, x, y, check_collisions=True) |
move(self, dx, dy, report_collisions=True) |
move_to(self, x, y, report_collisions=True) |
set_bbox(self, bbox, check_collisions=True) |
_adjacent(self, rect)If this body's bounding box is adjacent torect, then
return the side flag constant indicating the side that it is adjacent
on; otherwise, return False.
|
_check_notifications(self, owner) |
_checkmobile(self, val) |
_debug_check_cycles(self, cache) |
_remove_support(self)Remove this body's support. I.e., cause this body to no longer be supported. If the body was already unsupported, then this method has no effect. (This method does *not* call handle_lose_support.) |
_set_support(self, support)Set this body's support tosupport. If this body was
already supported by another body, then the new support repalces the
old one.
|
_set_xaccel(self, val) |
_set_xvel(self, val) |
_set_yaccel(self, val) |
_set_yvel(self, val) |
| Property Details |
|---|
is_solidA flag indicating whether this body can participate in collisions.
|
ownerA pointer to the game entity that owns this body. This entity will be notified about physical events that occur to the body. (Read-only)
|
supportThe body that supports this body, orNone if this body is
not supported.
|
support_sideThe side of this body that it's support is on. E.g., if the player is standing on top of a platform, then its support will be the platform, and itssupport_side will be BOTTOM.
support_side is expressed using the 'side' constants from pajammin.consts.
|
supported_bodiesA list of the bodies that are supported by this body.
|
xaccelThe x acceleration of the body, in pixels/sec^2.
|
xvelThe x velocity of the body, in pixels/sec.
|
yaccelThe y acceleration of the body, in pixels/sec^2.
|
yvelThe y velocity of the body, in pixels/sec.
|
| Instance Variable Details |
|---|
_supported_objectsA list of the bodies that are supported by this body. |
_supportThe body that supports this body, orNone if this body is
not supported.
|
_support_sideThe side of this body that it's support is on.support_side is expressed using the 'side' constants from pajammin.consts.
|
_is_mobileIs this a mobile body? |
_delayHow long has it been since our last update?
|
_notify_lose_supportTrue if the owner's handle_lose_support method should be called when we lose support. |
_notify_collisionTrue if the owner's handle_collision method should be called when we collide. |
physics_engineA pointer to the physics engine that manages this entity (if any). This is initialized byPhysicsEngine.add(). This pointer is used
to perform actions that might impact other bodies (such as move()).
|
solid_sidesA set of flags indicating which sides of the body are 'solid.' |
_bboxThe body's bounding box. |
_ownerA pointer to the game entity that owns this body. |
_xaccel, _yaccelThe acceleration of the body, in pixels/sec^2. |
_xfrac, _yfracA fractional offset to the bounding box, used to record movement distances that are less than a pixel in size. |
_xvel, _yvelThe velocity of the body, in pixels/sec. |
| Class Variable Details |
|---|
_supported_bodies
|
_xvel
|
_yvel
|
_xaccel
|
_yaccel
|
_xfrac
|
_yfrac
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Sep 22 22:52:46 2005 | http://epydoc.sf.net |