class Ship: public GameObj

This class represent the user spaceship

Inheritance:


Public Fields

[more]Point3f a
Acceleration of the ship (mt/sec^2)
[more]bool thrust
To know if the engine is on

Public Methods

[more]void Update(int t)
Ship version of the GameObj::Update()
[more]void ThrustOn()
Start the Thrust of the ship accellerating it
[more]void ThrustOff()
Stop the Thrust of the ship (accelleration = 0)
[more]void StartLeft()
Start the left rotation of ship
[more]void StartRight()
Start the right rotation of ship
[more]void StopLeft()
Stop the left rotation of ship
[more]void StopRight()
Stop the right rotation of ship
[more]int MaxBullet()
Return the maximum number of bullet currently available for this ship
[more]void Shoot(list<Bullet *> &LB)
Shoot a new bullet creating the object

Protected Fields

[more]int ActiveBullet
The number of active Bullet of this ship


Inherited from GameObj:

Public Fields

oPoint3f p
oPoint3f axis
ofloat angle
oPoint3f v
ofloat av
obool active

Public Methods

ovoid Draw()
oPoint3f VDir()


Documentation

This class represent the user spaceship. Please note the specialized redraw function and all the function to start and stop the thrust and the rotation of the ship. Note also the interface between the GameSession and Ship Classes when a ship fires: it return a pointer to the bullet that has fired. This interface works well when the ship fire only a single bullet it will probably be changed in the next releases.
oPoint3f a
Acceleration of the ship (mt/sec^2)

obool thrust
To know if the engine is on

ovoid Update(int t)
Ship version of the GameObj::Update(). It modifies the velocity according to the current acceleration

ovoid ThrustOn()
Start the Thrust of the ship accellerating it

ovoid ThrustOff()
Stop the Thrust of the ship (accelleration = 0)

ovoid StartLeft()
Start the left rotation of ship

ovoid StartRight()
Start the right rotation of ship

ovoid StopLeft()
Stop the left rotation of ship

ovoid StopRight()
Stop the right rotation of ship

oint MaxBullet()
Return the maximum number of bullet currently available for this ship

ovoid Shoot(list<Bullet *> &LB)
Shoot a new bullet creating the object

oint ActiveBullet
The number of active Bullet of this ship


Direct child classes:
TriShip
Ship3D

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.