#include <gSpawn.h>
Public Member Functions | |
gSpawnPoint (const eCoord &loc, const eCoord &dir) | |
~gSpawnPoint () | |
void | Spawn (eCoord &loc, eCoord &dir) |
REAL | Danger () |
void | Clear () |
Private Attributes | |
int | id |
eCoord | location |
eCoord | direction |
REAL | lastTimeUsed |
int | numberOfUses |
Friends | |
class | gArena |
Definition at line 33 of file gSpawn.h.
gSpawnPoint::gSpawnPoint | ( | const eCoord & | loc, | |
const eCoord & | dir | |||
) |
Definition at line 41 of file gSpawn.cpp.
00042 :id(-1),location(loc),direction(dir), 00043 lastTimeUsed(se_GameTime()-1000000),numberOfUses(0){}
void gSpawnPoint::Spawn | ( | eCoord & | loc, | |
eCoord & | dir | |||
) |
Definition at line 46 of file gSpawn.cpp.
References d, direction, lastTimeUsed, location, numberOfUses, se_GameTime(), sg_spawnBack, sg_spawnSide, gArena::SizeMultiplier(), and gCycleMovement::SpeedMultiplier().
Referenced by init_game_objects(), and sg_RespawnPlayer().
00046 { 00047 /* 00048 if (ArmageTronTimer-lastTimeUsed>100) 00049 numberOfUses=0; 00050 */ 00051 00052 int d,away; 00053 if (numberOfUses%2==1){ 00054 d=1; 00055 away=(numberOfUses+1)/2; 00056 } 00057 else{ 00058 d=-1; 00059 away=numberOfUses/2; 00060 } 00061 00062 dir=direction; 00063 00064 loc=location * gArena::SizeMultiplier() - dir.Turn(sg_spawnBack,-d*sg_spawnSide) * away * gCycle::SpeedMultiplier(); 00065 00066 lastTimeUsed=se_GameTime(); 00067 numberOfUses++; 00068 00069 }
REAL gSpawnPoint::Danger | ( | ) |
Definition at line 72 of file gSpawn.cpp.
References lastTimeUsed, numberOfUses, and se_GameTime().
00072 { 00073 return numberOfUses+(100/(se_GameTime()+10-lastTimeUsed)); 00074 }
void gSpawnPoint::Clear | ( | void | ) |
Definition at line 76 of file gSpawn.cpp.
References lastTimeUsed, numberOfUses, and se_GameTime().
00076 { 00077 lastTimeUsed=se_GameTime()-1000000; 00078 numberOfUses=0; 00079 }
int gSpawnPoint::id [private] |
Definition at line 36 of file gSpawn.h.
Referenced by gArena::NewSpawnPoint(), gArena::RemoveAllSpawn(), and gArena::~gArena().
eCoord gSpawnPoint::location [private] |
eCoord gSpawnPoint::direction [private] |
REAL gSpawnPoint::lastTimeUsed [private] |
int gSpawnPoint::numberOfUses [private] |