Home | Trees | Index | Help |
---|
Package pygsear :: Module Path :: Class PathNG |
|
Path
--+
|
PathNG
Next-generation Path
This one will integrate all of these disparate Path subclasses in to one uberclass. I think this will make it more usable.Method Summary | |
---|---|
__init__(self,
startLocation,
vx,
vy,
ax,
ay,
gx,
gy,
duration)
| |
Accelerate in the direction currently moving. | |
reverse travel in x-direction | |
reverse travel in y-direction | |
Decelerate according to the direction currently moving. | |
return direction to a point | |
return distance to a point | |
return acceleration | |
return direction of travel | |
return speed | |
return velocity | |
return next position along path | |
Go back to initial position, velocity and acceleration | |
Set acceleration. | |
Set deceleration. | |
set direction of travel | |
Set constant portion of acceleration (ie gravity) | |
Set a constraint on the path. | |
Change speed while keeping the same direction of movement. | |
Set acceleration to back go to on reset() | |
Set location to go back to on reset() | |
Set velocity to go back to on reset() | |
set turn rate in rad/s | |
Set velocity | |
show_restrictions(self)
| |
turn to the left by radians | |
turn_left(self)
| |
turn_right(self)
| |
turn_straight(self)
| |
turn as quickly as possible towards a point | |
_set_velocity(self,
vx,
vy)
| |
Inherited from Path | |
| |
Return position along Path | |
return x component of position | |
return y component of position | |
true if path position is on main window | |
stop moving along path | |
Path will raise StopIteration after self.duration seconds | |
Set position and update positionOld | |
resume moving along path |
Method Details |
---|
accelerate(self, acc)Accelerate in the direction currently moving. Accelerates toward 0 (right side of screen) if not moving. |
bounce_x(self)reverse travel in x-direction |
bounce_y(self)reverse travel in y-direction |
decelerate(self, dec)Decelerate according to the direction currently moving. |
direction(self, point)return direction to a point |
distance(self, point)return distance to a point |
get_acceleration(self)return acceleration Note that the acceleration may actually be a deceleration. |
get_direction(self)return direction of travel Direction is given in radians. 0 radians is towards the right edge of the screen.
|
get_speed(self)return speed |
get_velocity(self)return velocity |
next(self, t=None)return next position along path
|
reset(self)Go back to initial position, velocity and acceleration #Also updates self.ticks to current time
|
set_acceleration(self, ax=None, ay=None)Set acceleration. Change in speed depends on the acceleration and the time between frames.
|
set_deceleration(self, dex=None, dey=None)Set deceleration. Like acceleration, but acts to oppose the current velocity and will not change a 0 velocity. Can only accelerate or decelerate in a particular direction. Note that when using deceleration, the ax or ay value is always kept as an absolute value and a deceleration flag. There is no way to do "negative acceleration".
|
set_direction(self, direction)set direction of travel Maintains current speed. |
set_gravity(self, gx=None, gy=None)Set constant portion of acceleration (ie gravity)
|
set_restriction(self, onscreen=None, **kw)Set a constraint on the path. Restrictions are set as keyword arguments. So far these are the contraints that work:
|
set_speed(self, speed=None, change=None)Change speed while keeping the same direction of movement.
|
set_startAcceleration(self, accel=None)Set acceleration to back go to on reset()
|
set_startLocation(self, location=None)Set location to go back to on reset()
|
set_startVelocity(self, vel=None)Set velocity to go back to on reset()
|
set_turnRate(self, turnRate=0)set turn rate in rad/s |
set_velocity(self, special=None, vx=None, vy=None)Set velocity
|
turn(self, rad=None)turn to the left by radians |
turn_towards(self, point)turn as quickly as possible towards a point |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sat Dec 9 14:11:19 2006 | http://epydoc.sf.net |