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
[more]bool lthrust
To know if the left engine is on
[more]bool rthrust
To know if the right engine is on
[more]bool bonus
If the ship got the bonus

Public Methods

[more] Ship()
Ship Constructor
[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 StartStrafeLeft()
Start the left strafing of ship
[more]void StartStrafeRight()
Start the right strafing of ship
[more]void StopStrafeLeft()
Stop the left strafing of ship
[more]void StopStrafeRight()
Stop the right strafing of ship
[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
oSphere3f B

Public Methods

oint Draw()
oPoint3f VDir()
obool Collide(GameObj *o)
ovoid DrawBound()
obool operator < ( GameObj const & o ) const
obool operator == ( GameObj const & o ) const

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.
Version History
0.1
First Release.
0.1s
Changed the interface between the GameSession and Ship Classes when a ship fires Instead of returning a pointer to the bullet that has fired the function add the new bullets to the passed container.
0.2s
Added member functions for managing side movements and booleans to store the state of the side engines.
o Ship()
Ship Constructor. With respect to the GameObj constructor it initialize accelleration, engine flag and number of active bullet.

oPoint3f a
Acceleration of the ship (mt/sec^2)

obool thrust
To know if the engine is on

obool lthrust
To know if the left engine is on

obool rthrust
To know if the right 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 StartStrafeLeft()
Start the left strafing of ship

ovoid StartStrafeRight()
Start the right strafing of ship

ovoid StopStrafeLeft()
Stop the left strafing of ship

ovoid StopStrafeRight()
Stop the right strafing of ship

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

obool bonus
If the ship got the bonus

oint ActiveBullet
The number of active Bullet of this ship


Direct child classes:
Ship3D

Alphabetic index HTML hierarchy of classes or Java



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