Home | Trees | Index | Help |
---|
|
object
--+ |Entity
--+ |Agent
--+ | Walker
Ball
,
Moop
,
Spider
,
Turtle
,
TurtleRider
An agent that can walk and jump.
Each walker has a constant downward acceleration (determined by the global constant GRAVITY), which causes it to fall when it's not supported. When it lands on something, it stands on it (i.e., when its bottom collides with another body, it sets its support to be that body).
A walker's sprite category must define four sprite modes:'walk_left'
, 'walk_right'
,
'jump_left'
, and 'jump_right'
.
Method Summary | |
---|---|
Create a new agent at the given position. | |
Return a tuple (basename, speed) , indicating the animation name
and the animation speed that should be used by this agent's sprite, based
on the agent's current state. | |
face(self,
side)
| |
Called when one of the entity's bodies collides with another body. | |
Called when one of the entity's bodies becomes unsupported. | |
Actions | |
Walk in the given direction (LEFT or RIGHT). | |
Jump upwards. | |
Stop walking (i.e., set xvel to zero). | |
Inherited from Agent | |
Apply a temporary change to the "fixed" properties of this agent. | |
| |
Cause the agent to die. | |
Increase the health of this agent by the given amount. | |
Cause the given amount of damage to this agent. | |
(Class method) | |
Return true if this agent is hostile to the given agent. | |
Change the agent's sprite to display the animation with the given basename, for the duration of the animation (just one time through, if the animation normally loops). | |
(Class method) | |
Cancel one or more temporary changes to the "fixed" properties of this agent. | |
Say something... | |
Update the current state of this agent. | |
Update the animation mode and speed of this agent's sprite(s), based on the agent's state. | |
Inherited from Entity | |
| |
| |
| |
After the given duration has elapsed, call the given callback function. | |
Called when one of the entity's bodies moves. | |
| |
| |
Define this method for entities that the avatar can 'use'. | |
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 | |
---|---|
is_standing : Is the agent currently standing on something (i.e., supported)? | |
Inherited from Agent | |
bottom : The y coordinate of the bottom side of the agent's body. | |
center : The (x,y) position of the center of the agent's body. | |
left : The x coordinate of the left side of the agent's body. | |
right : The x coordinate of the right side of the agent's body. | |
top : The y coordinate of the top side of the agent's body. | |
x : The x coordinate of the center of the agent's body. | |
y : The y coordinate of the center of the agent's body. | |
Inherited from Entity | |
bodies | |
sprites |
Instance Variable Summary | |
---|---|
int |
jump_speed : The initial vertical speed with which this agent jumps, in
pixels/sec. |
int |
walk_speed : The horizontal speed at which this agent walks, in pixels/sec. |
Inherited from Agent | |
attack_cooldown_timer : ... | |
int |
attack_speed : A modifier for the rate at which this agent can attack. |
body : The agent's body. | |
effects : A list of the Effect s (temporary changes to fixed
properties) that are currently affecting this agent. | |
facing : The direction that the agent is currently facing. | |
str |
faction : The name of the faction that this agent belongs to. |
health : The number of health points this agent currently has. | |
int |
health_max : The maximum number of health points this agent can have. |
int |
health_regen : The rate at which this agent regains its health, in HP/sec. |
bool |
is_mortal : Determines whether this agent dies when its health reaches zero. |
mana : The number of mana points this agent currently has. | |
int |
mana_max : The maximum number of mana points this agent can have. |
int |
mana_regen : The rate at which this agent regains its mana, in MP/sec. |
dict |
resists : A dictionary describing the base amount that this agent resists each
damage type. |
Inherited from Entity | |
bool |
alive : A flag indicating whether the entity is alive or not. |
bodies = pajammin.entity.entity.Entity.bodies | |
NoneType |
level : A pointer to the level that contains this entity (if any). |
sprites = pajammin.entity.entity.Entity.sprites | |
NoneType |
update_delay : The amount of time that has elapsed since the last time update was
called for this entity. |
Class Variable Summary | |
---|---|
NoneType |
sprite_category : The category that should be used to create the primary sprites for
agents in each Walker subclass. |
Inherited from Agent | |
dict |
attack_types : A dictionary describing the types of attack that agents in this class
can make. |
NoneType |
bbox_size : The default size of the bounding box for agents in this class. |
list |
classes = [<class 'pajammin.entity.agent.flyer.WhiteBird...
|
int |
solid_sides : The sides of the agent's body which should be solid for agents in this
class. |
int |
update_interval : The interval at which entities in a given class should have its update
function called. |
Inherited from Entity | |
bool |
autouse = False
|
bool |
is_usable = False
|
Instance Method Details |
---|
walk(self, direction, walk_speed=None)Walk in the given direction (LEFT or RIGHT). |
jump(self, jump_speed=None)Jump upwards. If the walker is not currently standing on something,
then The initial upward velocity of the jump is formed by adding the agent's (negative) jump speed to the y velocity of the body supporting the agent. If a jump speed and/or x velocity is specified, then the walker will try to jump with the given speed/velocity. However, it will never exceed its jump_speed or walk_speed. |
stop(self)Stop walking (i.e., set xvel to zero). |
__init__(self,
x,
y)
Create a new agent at the given position. The new agent's health and
mana will be set to their maximum; and the direction it is facing will
be randomly chosen between |
current_animation(self)
|
face(self, side) |
handle_collision(self, obstacle, side)Called when one of the entity's bodies collides with another body. By default, this does nothing.
|
handle_lose_support(self, old_support)Called when one of the entity's bodies becomes unsupported. By default, this does nothing.
|
Property Details |
---|
is_standingIs the agent currently standing on something (i.e., supported)?
|
Instance Variable Details |
---|
jump_speedThe initial vertical speed with which this agent jumps, in pixels/sec.
|
walk_speedThe horizontal speed at which this agent walks, in pixels/sec.
|
Class Variable Details |
---|
sprite_categoryThe category that should be used to create the primary sprites for agents in eachWalker subclass.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:45 2005 | http://epydoc.sf.net |