home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 July & August
/
PCWorld_2006-07-08_cd.bin
/
temacd
/
planearcade
/
planearcade.exe
/
Tank3.bmp
/
spitfire.h
< prev
next >
Wrap
C/C++ Source or Header
|
2004-11-27
|
3KB
|
169 lines
//================================================================
#ifndef _SPITFIRE_H_
#define _SPITFIRE_H_
//================================================================
//hracove lietadlo - spitfire
//rychlos¥
#define SpitFire_MinSpeed 8.5f
#define SpitFire_MaxSpeed 12.0f
//kolizne a gulometove body
#define SpitFire_Left Get3D(-40.0f,0.0f,0.0f)
#define SpitFire_Right Get3D(40.0f,0.0f,0.0f)
#define SpitFire_Up Get3D(0.0f,6.0f,0.0f)
#define SpitFire_Down Get3D(0.0f,-6.0f,0.0f)
#define SpitFire_Front Get3D(0.0f,0.0f,20.0f)
#define SpitFire_Back Get3D(0.0f,0.0f,-43.0f)
#define SpitFire_BulletLeft Get3D(-15.42f,-2.0f,10.0f)
#define SpitFire_BulletRight Get3D(15.42f,-2.0f,10.0f)
//#define SpitFire_BulletLeft Get3D(-15.0f,-5.0f,0.0f)
//#define SpitFire_BulletRight Get3D(15.0f,-5.0f,0.0f)
//vrtula
#define SpitFire_VrtulaPoint Get3D(-0.419f,1.75f,20.0f)
//hlasitost zvuku
#define SpitFire_SoundScale 15.0f
//frekvencia strielania
#define SpitFire_BulletFreq 100.0f
//frekvencia bomb
#define SpitFire_BombFreq 220.0f
//maximalna cas mimo hracieho pola
#define SpitFire_MapSize 10000.0f
//----------------------------------------------------------------
// Name: SPITFIRE class
// Desc: hracove lietadlo
//----------------------------------------------------------------
class SPITFIRE
{
private:
MODEL ModelNormal1;
MODEL ModelNormal2;
MODEL ModelDestroyed;
MODEL ModelShadow;
MODEL ModelVrtula;
MODEL ModelKabina;
//zvuk
SOUND Sound;
bool SoundPlay;
//zisti koliziu
bool GetGroundCollision();
//zobrazenie ked je mimo mapy, mission failed,
//accomplished, stmavovanie obrazu
DXFONT MFont;
DXFONT Font;
DXFONT SmallFont;
PANEL2D BackGround;
PANEL2D MsgBack;
float BkTime;bool InMode;bool OutMode;
bool ComMode;bool FaiMode;bool ScoMode;
//message
float MessageOnTime;
float MessageLifeTime;
char MessageBuffer[120];
//fire bullet
PARTICLE BulletFire;
float BulletAlpha;
float Bullet1Rot;
float Bullet2Rot;
public:
//vlastnosti
float Speed;
int Life;
int Bombs;
int Score;
int FakeScore;
int ModelMode;
bool ShowCompas;
bool ShowFPS;
bool ShowMap;
bool ShowKokpit;
//m≤dy
bool NormalMode;
bool CrazyMode;
bool DestroyedMode;
//pozicia a matica
VECTOR3D Pos;
VECTOR3D Rot;
VECTOR3D ConRot;
D3DXMATRIX Matrix;
//vrtula
VECTOR3D PV;
float VrtulaRotation;
//kolizne body
VECTOR3D PL,PR,PU,PD,PF,PB ;
//bod pre sledovanie
VECTOR3D SlPoint;
//strely
BULLETSYSTEM Bullet;
VECTOR3D BL,BR;
bool BulletActive;
float BulletTime;
//bomby
BOMBSYSTEM Bomb;
float BombTime;
//mission failed, completed
void MissionFailed();
void MissionExit();
void MissionCompleted();
//zastavi zvuk
void StopSound();
//inicializacia
void Initialize();
//system
void Reset();
//refresh
void Refresh();
//camera
void SetCamera();
//render
void Render1(); //models
void Render2(); //particles
//oznamy a obrazovky
void DrawScreens();
//vytlac oznam pre hraca
void DrawMessage(char *MessageEng,char *MessageCze,float LifeTime);
//kolizia s lietadlom
bool CollisionDetail(VECTOR3D P1, VECTOR3D P2);
bool CollisionBox(VECTOR3D P1, VECTOR3D P2);
};
//================================================================
#endif //_SPITFIRE_H_