![]() |
Dragonfly 2.2
A text-based game engine
|
Public Member Functions | |
GameObject (int on_level=-1) | |
bool | isSolid () |
True if hard or soft, else False. | |
int | setSolidness (Solidness new_solid) |
Set object solidness, with checks for consistency. | |
Solidness | getSolidness () |
Return object altitude. | |
int | setVisibility (bool visible) |
Set visibility of object. | |
int | setPersistence (bool persistent) |
Set persistence of object. Returns 0. | |
int | setAltitude (int new_altitude) |
Set object altitude, with checks for consistency. | |
int | getAltitude () |
Return object altitude. | |
void | setXVelocity (float new_x_velocity) |
float | getXVelocity () |
void | setYVelocity (float new_y_velocity) |
float | getYVelocity () |
int | getXVelocityStep () |
Perform 1 step of velocity in horizontal direction. | |
int | getYVelocityStep () |
Perform 1 step of velocity in vertical direction. | |
Protected Attributes | |
float | x_velocity |
Horizontal speed in spaces per game step. | |
float | x_velocity_countdown |
Countdown to horizontal movement. | |
float | y_velocity |
Veritical speed in spaces per game step. | |
float | y_velocity_countdown |
Countdown to vertical movement. | |
Private Attributes | |
int | altitude |
-MAX to MAX supported (lower drawn first). | |
Solidness | solidness |
Solidness state of object. |
int GameObject::getXVelocityStep | ( | ) |
Perform 1 step of velocity in horizontal direction.
Return horizontal distance moved this step.
int GameObject::getYVelocityStep | ( | ) |
Perform 1 step of velocity in vertical direction.
Return vertical distance moved this step.
int GameObject::setAltitude | ( | int | new_altitude | ) |
Set object altitude, with checks for consistency.
Return 0 if ok, else -1.
int GameObject::setSolidness | ( | Solidness | new_solid | ) |
Set object solidness, with checks for consistency.
Return 0 if ok, else -1.
int GameObject::setVisibility | ( | bool | visible | ) | [virtual] |