飞机游戏源码学习小结
来源:互联网 发布:南昌淘宝运营公司 编辑:程序博客网 时间:2024/05/21 22:34
学习飞机游戏源码小结
1.其中一个类CGame
class CGame
{
public:
CGame();
virtual ~CGame();
//显示信息
void DrawMessage(CDC*pDC,int width,int height);
//火力位图是否出现
void FireOutIf();
//子弹移动
void shotmove();
//敌机发射子弹
void Enemyshot();
//敌机出现
void Enemyplaneout();
//我方射击
void Shot();
//设置透明位图
void TransparentBitmap(HDC hdc, HBITMAP hBitmap,
short xStart, short yStart, short xadd,short yadd,
COLORREF cTransparentColor);
//透明色
COLORREF cTransparentColor;
//飞机爆炸位图
CBitmap enemydead;
//敌机子弹位图
CBitmap bmenemyshot;
//敌机位图
CBitmap enemy;
//我方子弹
CBitmap bmshot;
//我方飞机
CBitmap plane;
//我方飞机数量
short numplane;
//背景数组
int back[15][12];
//飞机出现位置
int xStart,yStart;
//火力位图
CBitmap bmfire;
//火力位置
CPoint pointfire;
//是否出现
bool iffire;
//火力强度
int fire;
};
主要是一个游戏的类,其中注意的是CBitmap类,用于加载图片
2.class CMainFrame : public CFrameWnd
{
CRect m_FullScreenRect;//全屏显示时的窗口位置
// Attributes
public:
void OnFullScreen();
};
CRect 用于位置信息
3.CVIEW全图显示的类
class CMy6_1View : public CView
{
public:
CMy6_1Doc* GetDocument();
public:
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
public:
//暂停
bool bPause;
//屏幕宽度
int width;
//屏幕高度
int height;
//类CGame
CGame game;
//背景位图移动大小:10
int goup;
//背景位图
CBitmap backmap;
virtual ~CMy6_1View();
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
};
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg宏表示声明的是一个消息响应函数
- 飞机游戏源码学习小结
- 【Unity3D 游戏】 打飞机(仿微信打飞机) 源码
- 学习飞机游戏的心得
- 飞机游戏中子弹与飞机的移动与边界源码
- 飞机大战的山寨版游戏源码
- 飞机大战游戏及源码地址
- JavaScript学习之仿微信打飞机游戏
- 飞机游戏
- 飞机游戏
- 飞机游戏
- 飞机游戏
- 《飞机游戏》
- 飞机游戏
- 飞机游戏
- 飞机游戏
- 微信打飞机源码,适配iphone5打飞机游戏源码(cocos2d-iphone:)
- 微信飞机大战源码学习总结
- Unity飞机大战 源码 分享 学习
- 状态模式——水之三态
- border-image
- linux下c的共享库和静态库
- 7月20日--8月1日30小时,剩3600小时
- HashTable, HashSet, HashMap的区别
- 飞机游戏源码学习小结
- tcpdump 抓包
- codeforces543AWriting Code(完全背包)
- OSG中的粒子系统
- OC_NSDictionary和NSMutableDictionary
- Ubuntu14.04安装OpenCV3.0
- 使用eclipse tool 逆向生成Hiberante类xml、和hbm.xml
- ReSharper 配置及用法
- AFNetworking和ASIHTTPRequest的比较