資源簡介
基于Windows編程的打飛機小游戲源代碼
c++
學習游戲的最好的起步程序
代碼片段和文件信息
#include?“Background.h“
CBackground::CBackground(void)
{
hDC????=??CreateCompatibleDC(NULL);
hImgDC?=?CreateCompatibleDC(NULL);
hBkgBMP???=?(HBITMAP)LoadImage(?NULL“images/bkg.bmp“?IMAGE_BITMAP?0?0LR_LOADFROMFILE);
Selectobject(hImgDChBkgBMP);
Getobject(hBkgBMPsizeof(bkgBMP)&bkgBMP);
HDC?g_dc?=?::GetDC(GetActiveWindow());
hScreenBMP?=?CreateCompatibleBitmap(g_dc800600);
Selectobject(hDChScreenBMP);
this->nImgHeight?=?bkgBMP.bmHeight;
this->nImgWidth?=?bkgBMP.bmWidth;
this->startX?=?0;
this->startY?=?0;
this->nYOffset?=?0;
this->nXNum?=??screenWidth/nImgWidth;
this->nYNum?=?screenHeight/nImgHeight;
}
CBackground::~CBackground(void)
{
}
bool?CBackground::MoveForward(){
nYOffset?=?(nYOffset+1)%nImgHeight;
for?(int?i?=?0?;?i? {
for?(int?j?=?-1?;?j? {
BitBlt(hDCi*nImgWidthj*nImgHeight+nYOffsetnImgWidthnImgHeighthImgDC00SRCCOPY);
}
}
return?true;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4396??2010-09-24?17:14??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\FightingPlane.DPbcd
?????文件?????237568??2011-09-12?13:36??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\FightingPlane.exe
?????文件?????993460??2011-09-12?13:36??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\FightingPlane.ilk
?????文件????1944576??2011-09-12?13:36??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\FightingPlane.pdb
?????文件????????467??2010-09-24?20:03??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\gates.ini
?????文件????????462??2010-09-24?20:00??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\gates.ini.bak
?????文件????1440054??2010-09-24?12:33??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\bkg.bmp
?????文件???????1638??2010-09-24?15:07??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\BOMB.bmp
?????文件??????28854??2002-05-24?17:47??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\BONUS.BMP
?????文件????????246??2010-09-21?01:29??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\BULLET.bmp
?????文件???????4198??2003-03-10?19:10??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\CENTER.BMP
?????文件???????9882??2010-09-22?14:15??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\ENEMY1.bmp
?????文件??????13958??2010-09-22?14:15??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\ENEMY2.bmp
?????文件??????40074??2010-09-22?14:16??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\ENEMY3.bmp
?????文件?????140454??2010-09-22?17:39??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\EXPLODE1.bmp
?????文件??????37654??2010-09-22?17:39??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\EXPLODE2.bmp
?????文件?????481078??2010-09-24?01:48??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\gameover.bmp
?????文件???????4198??2003-03-05?16:11??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\LEFT.BMP
?????文件????1440054??2010-09-24?14:55??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\lightning.bmp
?????文件?????481078??2010-09-24?16:05??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\loading.bmp
?????文件??????12826??2010-09-24?16:07??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\press.bmp
?????文件???????4198??2003-03-05?16:11??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\RIGHT.BMP
?????文件?????481078??2010-09-24?19:30??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\debug\Images\win.bmp
?????文件????????903??2010-09-24?20:15??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPane.sln.bak
?????文件????????973??2010-09-24?13:05??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Background.cpp
?????文件????????571??2010-09-24?13:05??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Background.h
?????文件?????????76??2010-09-24?15:18??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Bomb.cpp
?????文件???????1256??2010-09-24?14:22??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Bonus.cpp
?????文件????????945??2010-09-24?13:50??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Bonus.h
?????文件????????761??2010-09-24?17:44??Windows小游戲demo\《戰斗機》項目文件\FightingPlane\FightingPlane\Bullet.cpp
............此處省略73個文件信息
評論
共有 條評論