SuperTux Class Reference

#include <supertux.h>

Inheritance diagram for SuperTux:

Inheritance graph
[legend]
Collaboration diagram for SuperTux:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SuperTux (SuperTuxWeaponConfig &cfg, WeaponLauncher *p_launcher)
void Refresh ()
void SetAngle (double angle)
void turn_left ()
void turn_right ()
void Shoot (double strength)

Public Attributes

uint speed
uint time_now
uint time_next_action
uint last_move

Protected Member Functions

void SignalOutOfMap ()

Private Attributes

ParticleEngine particle_engine
double angle_rad

Detailed Description

Definition at line 41 of file supertux.h.


Constructor & Destructor Documentation

SuperTux::SuperTux ( SuperTuxWeaponConfig cfg,
WeaponLauncher p_launcher 
)

Definition at line 38 of file supertux.cpp.

00039                                                 :
00040   WeaponProjectile ("supertux", cfg, p_launcher),
00041   particle_engine(40)
00042 {
00043   explode_colliding_character = true;
00044   SetSize(image->GetSize());
00045   SetTestRect(1, 1, 2, 2);
00046 }

Here is the call graph for this function:


Member Function Documentation

void SuperTux::Refresh (  )  [virtual]

Reimplemented from WeaponProjectile.

Definition at line 59 of file supertux.cpp.

00060 {
00061   WeaponProjectile::Refresh();
00062 
00063   image->SetRotation_rad(angle_rad + M_PI_2);
00064   if ((last_move+animation_deltat)<Time::GetInstance()->Read())
00065   {
00066     SetExternForce(static_cast<SuperTuxWeaponConfig&>(cfg).speed, angle_rad);
00067     image->Update();
00068     last_move = Time::GetInstance()->Read();
00069   }
00070 
00071   if(ActiveTeam().IsLocal() || ActiveTeam().IsLocalAI())
00072   {
00073     Action a(Action::ACTION_SUPERTUX_STATE);
00074     a.Push(angle_rad);
00075     a.Push(GetPhysX());
00076     a.Push(GetPhysY());
00077     Point2d speed;
00078     network.SendAction(&a);
00079   }
00080   particle_engine.AddPeriodic(GetPosition(), particle_STAR, false, angle_rad, 0);
00081 }

Here is the call graph for this function:

void SuperTux::SetAngle ( double  angle  )  [inline]

Definition at line 57 of file supertux.h.

00057 {angle_rad = angle;}

Here is the caller graph for this function:

void SuperTux::Shoot ( double  strength  )  [virtual]

Reimplemented from WeaponProjectile.

Definition at line 48 of file supertux.cpp.

00049 {
00050   WeaponProjectile::Shoot(strength);
00051   angle_rad = ActiveCharacter().GetFiringAngle();
00052 
00053   Time * global_time = Time::GetInstance();
00054   time_next_action = global_time->Read();
00055   last_move = global_time->Read();
00056   begin_time = global_time->Read();
00057 }

Here is the call graph for this function:

void SuperTux::SignalOutOfMap (  )  [protected, virtual]

Reimplemented from WeaponProjectile.

Definition at line 103 of file supertux.cpp.

00104 {
00105   GameMessages::GetInstance()->Add (_("Bye bye tux..."));
00106   WeaponProjectile::SignalOutOfMap();
00107 }

Here is the call graph for this function:

void SuperTux::turn_left (  ) 

Definition at line 83 of file supertux.cpp.

00084 {
00085   time_now = Time::GetInstance()->Read();
00086   if (time_next_action<time_now)
00087     {
00088       time_next_action=time_now + time_delta;
00089       angle_rad = angle_rad - M_PI / 12;
00090     }
00091 }

Here is the call graph for this function:

Here is the caller graph for this function:

void SuperTux::turn_right (  ) 

Definition at line 93 of file supertux.cpp.

00094 {
00095   time_now = Time::GetInstance()->Read();
00096   if (time_next_action<time_now)
00097     {
00098       time_next_action=time_now + time_delta;
00099       angle_rad = angle_rad + M_PI / 12;
00100     }
00101 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

double SuperTux::angle_rad [private]

Definition at line 45 of file supertux.h.

uint SuperTux::last_move

Definition at line 51 of file supertux.h.

ParticleEngine SuperTux::particle_engine [private]

Definition at line 44 of file supertux.h.

uint SuperTux::speed

Definition at line 48 of file supertux.h.

uint SuperTux::time_next_action

Definition at line 50 of file supertux.h.

uint SuperTux::time_now

Definition at line 49 of file supertux.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 14:19:17 2007 for Wormux by  doxygen 1.4.7