Home | Trees | Index | Help |
---|
|
A physics engine for platform games.
The physics engine manages a collection of bodies. These bodies are moved automatically, based on their velocities, by callingupdate
at regular intervals; and can also
be moved explicitly (e.g., with move
).
Method Summary | |
---|---|
__init__(self)
| |
add(self,
body)
| |
Return a list of all bodies managed by the physics engine | |
Return a list of all bodies intersecting the given point. | |
Return a list of all bodies intersecting the given rect. | |
If it is possible to move the given body by the specified distance without causing a collision at the destination, then do so. | |
jump_to(self,
body,
x,
y,
check_collisions)
| |
Move the given body (and any supported bodies) by the specified distance. | |
move_to(self,
body,
x,
y,
report_collisions)
| |
remove(self,
body)
| |
Attempt to change the given body's bounding box to bbox . | |
Update the positions of all bodies in the world. |
Class Variable Summary | |
---|---|
bool |
debug = False
|
Method Details |
---|
__init__(self)
|
add(self, body) |
bodies(self, include_nonsolids=True)
|
bodies_intersecting_point(self, x, y, include_nonsolids=True)
|
bodies_intersecting_rect(self, rect, include_nonsolids=True)
|
jump(self, body, dx, dy, check_collisions=True)If it is possible to move the given body by the specified distance without causing a collision at the destination, then do so. Otherwise, just return False. Do not move supported objects.
|
jump_to(self, body, x, y, check_collisions=True) |
move(self, body, dx, dy, report_collisions=True)Move the given body (and any supported bodies) by the specified distance. If the movement results in a collision (by this body -- not supported ones), then generate collision messages for both colliding bodies, and return False. Otherwise, return True.
|
move_to(self, body, x, y, report_collisions=True) |
remove(self, body) |
set_bbox(self, body, bbox, check_collisions=True)Attempt to change the given body's bounding box tobbox . If that would cause a collision, then just return
false; do not perform the move or generate any collision messages.
|
update(self, interval, pos)Update the positions of all bodies in the world. Bodies that are close to the given pos (within 1000 pixels or so) will be updated at a much higher frequency than bodies that are farther away. |
Class Variable Details |
---|
debug
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:44 2005 | http://epydoc.sf.net |