?? bullet.h
字號:
// Bullet.h: interface for the CBullet class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BULLET_H__B5E6C45D_3C68_4CF3_B36A_A062FCEC8ED5__INCLUDED_)
#define AFX_BULLET_H__B5E6C45D_3C68_4CF3_B36A_A062FCEC8ED5__INCLUDED_
#include "Tank_Defs.h" // Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
const int START=1;
const int MIDDLE=2;
const int END=3;
class CGame;
//##ModelId=3EBA49A3029F
class CBullet
/****************************************************************
*基類 *
*歸納各種子彈的共性,并提供純虛函數(shù)接口 *
****************************************************************/
{
public:
//##ModelId=3EBA49A30303
CBullet();
//##ModelId=3EBA49A30302
virtual ~CBullet();
public:
//##ModelId=3EBA49A30300
void DestroyObj(Obj &object);
//##ModelId=3EBA49A302FD
Obj HasObject(int xpos,int ypos);
//##ModelId=3EBA49A302F5
void SetBulletBmp(LPDIRECTDRAWSURFACE bmp);
//##ModelId=3EBA49A302F3
void CBullet::DrawBullet(LPDIRECTDRAWSURFACE pdds);
//##ModelId=3EBA49A302F0
void SetPosition(int n,int m);
//##ModelId=3EBA49A302EF
int MapxyTonXnY();
//##ModelId=3EBA49A302E6
Result IsWhat(int xt,int yt);//從地圖里面判斷前方是什么
//##ModelId=3EBA49A302E4
BOOL ChangeColor(COLORREF x=0x00000000ff); //改變顏色
//##ModelId=3EBA49A302E3
virtual BOOL BulletTrack()=0; //各種子彈的彈道
//##ModelId=3EBA49A302E1
BOOL BulletAnimate(int state=START); //各種子彈得動畫(三階段:出發(fā),飛行途中,擊中)
//##ModelId=3EBA49A302DF
void SetSpeed(int speed=4){m_nSpeed=speed;}
//##ModelId=3EBA49A302D7
void SetDamage(int n=50){m_nDamage=n;}
//##ModelId=3EBA49A302D6
int GetDamage()const{return m_nDamage;}
//##ModelId=3EBA49A302D5
int GetSpeed(){return m_nSpeed;}
//##ModelId=3EBA49A302BF
CRect rect;
//##ModelId=3EBA49A302D4
void SetRect(){rect.SetRect(x,y,x+BULLETWIDTH,y+BULLETHEIGHT);}
//##ModelId=3EBA49A302D2
inline void SetDirection(TankDirection direction){m_nDirection=direction;}
//##ModelId=3EBA49A302D0
inline void SetGame(CGame * pGame){ m_pGame=pGame;}
//##ModelId=3EBA49A302CF
inline int Getx(){return x;}
//##ModelId=3EBA49A302CE
inline int Gety(){return y;}
//##ModelId=3EBA49A302C4
inline void SetBelong(BYTE a){Belong=a;}
//##ModelId=3EBA49A302C2
inline void Setx(int m){x=m;} //以下兩種方法主要針對子彈雙發(fā)而設(shè)置
//##ModelId=3EBA49A302C0
inline void Sety(int n){y=n;}
protected:
//##ModelId=3EBA49A302BC
LPDIRECTDRAWSURFACE m_bmpBullet;
//##ModelId=3EBA49A302B9
CString strMsg;
//##ModelId=3EBA49A302B6
CGame *m_pGame;
//##ModelId=3EBA49A302B1
TankDirection m_nDirection;
//##ModelId=3EBA49A302A5
int m_nSpeed; //用來記錄子彈速度基數(shù)
//##ModelId=3EBA49A302A4
int m_nX; //記錄子彈的x位置--以中軸線為基準(zhǔn)
//##ModelId=3EBA49A302A3
int m_nY; //記錄子彈的y位置
int x,y; //對應(yīng)象素坐標(biāo)
//##ModelId=3EBA49A302A2
int m_nDamage; //記錄子彈傷害力
//##ModelId=3EBA49A302A1
int index; //標(biāo)定是那一種子彈
//##ModelId=3EBA49A302A0
BYTE Belong; //標(biāo)定子彈的出處/* 3,NPC、1,left-play、2,right-play*/
};
#endif // !defined(AFX_BULLET_H__B5E6C45D_3C68_4CF3_B36A_A062FCEC8ED5__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -