資源簡介
山科實訓做的飛機大戰,c++版。有源代碼、圖片素材和程序,工具為VS2013
代碼片段和文件信息
//?Boom.cpp?:?實現文件
//
#include?“stdafx.h“
#include?“MyPlane.h“
#include?“Boom.h“
#include?“resource.h“
//?CBoom
CImageList?CBoom::imglist0;
CImageList?CBoom::imglist1;
CImageList?CBoom::imglist2;
CImageList?CBoom::imglist3;
CImageList?CBoom::imglist4;
CImageList?CBoom::imglist5;
CImageList?CBoom::imglist6;
CBoom::CBoom()
:?pos(0)
?index(1)
?Type(0)
{
}
CBoom::~CBoom()
{
}
//?CBoom?成員函數
bool?CBoom::draw(CDC*?pDC)
{
if?(Type?==?0)
imglist0.Draw(pDCindexCPoint(pos.xpos.y)NULL);
else?if?(Type?==?1)
imglist1.Draw(pDC?index?CPoint(pos.x-20?pos.y-14)?NULL);
else?if?(Type?==?2)
imglist2.Draw(pDC?index?CPoint(pos.x-35?pos.y-50)?NULL);
else?if?(Type?==?3)
imglist3.Draw(pDC?index?CPoint(pos.x?-?43?pos.y?-?59)?NULL);
else?if?(Type?==?4)
imglist4.Draw(pDC?index?CPoint(pos.x-20?pos.y-14)?NULL);
else?if?(Type?==?5)
imglist5.Draw(pDC?index?CPoint(pos.x-35?pos.y-50)?NULL);
else?if?(Type?==?6)
imglist6.Draw(pDC?index?CPoint(pos.x?-?43?pos.y?-?59)?NULL);
return?false;
}
bool?CBoom::loadimage(int?type)
{
CBitmap?bitmap0;
CBitmap?bitmap1;
CBitmap?bitmap2;
CBitmap?bitmap3;
CBitmap?bitmap4;
CBitmap?bitmap5;
CBitmap?bitmap6;
if?(type?==?0)
{
imglist0.Create(72?94?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap0.LoadBitmap(IDB_PlaneBoom);
imglist0.Add(&bitmap0?RGB(255?255?255));
}
else?if?(type?==?1)
{
imglist1.Create(47?33?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap1.LoadBitmap(IDB_SmallfplaneBoom);
imglist1.Add(&bitmap1?RGB(255?255?255));
}
else?if?(type?==?2)
{
imglist2.Create(69?90?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap2.LoadBitmap(IDB_FplaneBoom);
imglist2.Add(&bitmap2?RGB(255?255?255));
}
else?if?(type?==?3)
{
imglist3.Create(86?118?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap3.LoadBitmap(IDB_FBigboom);
imglist3.Add(&bitmap3?RGB(255?255?255));
}
else?if?(type?==?4)
{
imglist4.Create(47?33?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap4.LoadBitmap(IDB_FSmallfplaneBoom);
imglist4.Add(&bitmap4?RGB(255?255?255));
}
else?if?(type?==?5)
{
imglist5.Create(70?95?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap5.LoadBitmap(IDB_FFplaneBoom);
imglist5.Add(&bitmap5?RGB(255?255?255));
}
else?if?(type?==?6)
{
imglist6.Create(86?118?ILC_COLOR24?|?ILC_MASK?1?1);
bitmap6.LoadBitmap(IDB_Bigboom1);
imglist6.Add(&bitmap6?RGB(255?255?255));
}
return?false;
}
bool?CBoom::drawtxt(CDC*?pDC)
{
CPen?pen;
pen.CreatePen(PS_SOLID?2?RGB(0?255?0));
pDC->Selectobject(&pen);
pDC->SetTextColor(RGB(0?0?0));
CString?s1?=?_T(“+100“);
CString?s2?=?_T(“+500“);
CString?s3?=?_T(“+1000“);
if?(Type==1||Type==4)
pDC->TextOutW(pos.x+20?pos.y-40s1);
else?if?(Type==2||Type==5)
pDC->TextOutW(pos.x+30?pos.y-40?s2);
else?pDC->TextOutW(pos.x?+?40?pos.y?-?80?s3);
return?false;
}
CRect?CBoom::GetRect()
{
if?(Type?==?1||Type==4)
retu
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-05-25?22:56??MyPlane\
?????目錄???????????0??2016-05-25?22:55??MyPlane\Debug\
?????文件?????8215040??2016-05-25?22:55??MyPlane\Debug\MyPlane.exe
?????文件?????1695424??2016-05-25?22:55??MyPlane\Debug\MyPlane.ilk
?????文件?????6754304??2016-05-25?22:55??MyPlane\Debug\MyPlane.pdb
?????目錄???????????0??2016-05-25?22:54??MyPlane\MyPlane\
?????文件?????8214016??2016-01-01?14:14??MyPlane\MyPlane.exe
?????文件????79298560??2016-05-25?22:56??MyPlane\MyPlane.sdf
?????文件?????????967??2015-12-24?13:58??MyPlane\MyPlane.sln
?????文件????????9728??2016-05-25?22:56??MyPlane\MyPlane.v12.suo
?????文件????????3286??2016-01-01?09:56??MyPlane\MyPlane\Boom.cpp
?????文件?????????563??2016-01-01?09:56??MyPlane\MyPlane\Boom.h
?????文件?????????622??2016-01-01?14:10??MyPlane\MyPlane\Bullet.cpp
?????文件?????????250??2016-01-01?09:47??MyPlane\MyPlane\Bullet.h
?????文件??????????60??2013-07-22?01:18??MyPlane\MyPlane\ClassDiagram.cd
?????文件????????3255??2015-12-30?11:24??MyPlane\MyPlane\ClassDiagram1.cd
?????目錄???????????0??2016-05-25?22:55??MyPlane\MyPlane\Debug\
?????文件???????45116??2016-05-25?22:55??MyPlane\MyPlane\Debug\Boom.obj
?????文件???????16228??2016-05-25?22:55??MyPlane\MyPlane\Debug\Bullet.obj
?????文件???????22590??2016-05-25?22:55??MyPlane\MyPlane\Debug\Fplane.obj
?????文件???????10953??2016-05-25?22:55??MyPlane\MyPlane\Debug\Gameob
?????文件???????25240??2016-05-25?22:55??MyPlane\MyPlane\Debug\Leveldlg.obj
?????文件???????58120??2016-05-25?22:55??MyPlane\MyPlane\Debug\MainFrm.obj
?????文件???????16289??2016-05-25?22:55??MyPlane\MyPlane\Debug\Mybullet.obj
?????文件????????2737??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.log
?????文件???????54829??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.obj
?????文件????43122688??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.pch
?????文件?????6696464??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.res
?????目錄???????????0??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.tlog\
?????文件????????9210??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.tlog\cl.command.1.tlog
?????文件???????59402??2016-05-25?22:55??MyPlane\MyPlane\Debug\MyPlane.tlog\CL.read.1.tlog
............此處省略78個文件信息
評論
共有 條評論