91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.64MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2024-02-02
  • 語言: C/C++
  • 標簽: C++??Win32??Game??Car??

資源簡介

去年大三電子游戲設計課程設計寫的C++賽車游戲,要畢業了,今天突然翻出來給大家參考一下。本人系PHPer,對于C++稱不上熟悉,基本是用面向過程的思想完成了此游戲,讓各位見笑了。有興趣的做朋友的歡迎訪問我的博客liuboye.com

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?
#include??
#include?
#pragma?comment(lib?“WINMM.LIB“)

#define?MAX_LOADSTRING?100

//定義結構體
struct?BULLET???????//bullet結構體代表賽車導彈
{
int?xy;????????//子彈坐標
bool?exist;?????//子彈是否存在
};

struct?OBSTACLE{
int?xy;
bool?exist;
};

struct?PRODUCT{
int?xy;
int?flag;?//1代表加子彈?2代表energy?3代表加速?4代表延長時間?
bool?exist;
};

//全局變量聲明
HINSTANCE?hInst;
HBITMAP?bgcarbulletbulletshowobstacleexplosionroadlifegameovergamewinenergyammotimequickdirectionlightstatusshowplaneplanelifeplaneammoplanetimeplanequick;?????//存儲背景圖,賽車圖,子彈圖,路,生命,彈藥,時間,加速,終點
HDC hdcmdcbufdcexplosionDC;
HWND hWnd;
DWORD tPretNow;????????//前一時刻的時間,當前時刻的時間
int nowXnowY;????//nowX,nowY代表賽車坐標
int?????ocount=0explosionNum=-1explosionLocXexplosionLocY;????//滾動背景偏移量,子彈計數器
int cutHeight=0dirHeight=0bcount=0bnum=10lnum=5pnum=0;???????//cutHeight為滾動背景所要裁剪的區域寬度,bcount記錄賽車現有子彈數目,bnum記錄當前剩余彈藥數目,lnum記錄生命值pnum記錄生成物數目
int totalTime=30totalLength=43000raceTime=0raceLength=0;???????//時間,駕駛距離,賽道長
BULLET??b[10];???????????//聲明一個“bullet”類型的數組,用來存儲賽車發出的子彈
const?int?obstacleLevel=3;
OBSTACLE?o[obstacleLevel];
PRODUCT??p[10];
int?startNum=0;
bool?iStart=false;//是否開始比賽
bool?explosionflag=false;?//是否爆炸
bool?createObstacleFlag=false;//是否創建障礙物
bool?speedUp=false;?//前移動同時加速
bool?speedDown=false;?//下移動同時減速
bool?speedLeft=false;?//左移動
bool?speedRight=false;//右移動
bool?isMoving?=?false;?//是否在移動
int?leftBorder=140;//左邊界
int?rightBorder=410;//左邊界
int?upBorder=300;//上邊界
int?downBorder=400;//下邊界
int?velocity=0;????//速度
int?accSpeed=1;????//加速度
int?maxVelocity=70;?//最大速度,直接影響游戲的操作難度
int?minVelocity=-20;?//最小速度
int?slideVelocity=5;?//左右滑動速度
int?convertRate=4;???//速度畫面換算比率
int?sleepTime=50;????//暫停時間
int?lifeFlag=0;
int?bulletFlag=0;
bool?planeLifeFlag=false;
bool?planeLifeNum=0;
bool?planeAmmoFlag=false;
bool?planeAmmoNum=0;
bool?planeTimeFlag=false;
bool?planeTimeNum=0;
bool?planeQuickFlag=false;
bool?planeQuickNum=0;




//全局函數聲明
ATOM MyRegisterClass(HINSTANCE?hInstance);
BOOL InitInstance(HINSTANCE?int);
LRESULT?CALLBACK WndProc(HWND?UINT?WPARAM?LPARAM);
void MyPaint(HDC?hdc);
bool checkHit(intintintintintintintint);
bool isCollide(RECT?RECT);
void move();
void playMusic(int);
void setCutHeight(int?value);
void setObstaclePos();
void setRaceLength();
void stopCar();
VOID?CALLBACK startGame(HWND?UINT?UINT?DWORD);
VOID?CALLBACK checkExplosion(HWND?UINT?UINT?DWORD);
VOID?CALLBACK createObstacle(HWND?UINT?UINT?DWORD);
VOID?CALLBACK myTimer(HWND?UINT?UINT?DWORD);????????//計時
VOID?CALLBACK recoverVelocity(HWND?UINT?UINT?DWORD);????????//恢復最大速度
VOID?CALLBACK???????recoverAmmo(HWND?UINT?UINT?DWORD);
VOID?CALLBACK???????recoverTime(HWND?UINT?UINT?DWORD);
VOID?CALLBACK???????recoverLife(HWND?UINT?UINT?DWORD);
VOID?CALLBACK???????recoverQuick(HWND?UINT?UINT?DWORD);

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????26513??2014-03-07?14:17??crazycar\crazycar.cpp

?????文件???????4192??2013-07-11?16:40??crazycar\crazycar.dsp

?????文件????????522??2013-07-09?21:37??crazycar\crazycar.dsw

?????文件????????326??2013-07-09?19:30??crazycar\crazycar.h

?????文件??????66560??2013-07-18?19:51??crazycar\crazycar.ncb

?????文件??????52736??2013-07-18?19:51??crazycar\crazycar.opt

?????文件???????1162??2013-07-15?09:46??crazycar\crazycar.plg

?????文件?????192566??2013-07-15?09:46??crazycar\Debug\crazycar.exe

?????文件?????352316??2013-07-15?09:46??crazycar\Debug\crazycar.ilk

?????文件??????64023??2013-07-15?09:46??crazycar\Debug\crazycar.obj

?????文件????1876368??2013-07-11?16:40??crazycar\Debug\crazycar.pch

?????文件?????599040??2013-07-15?09:46??crazycar\Debug\crazycar.pdb

?????文件???????5576??2013-07-10?22:03??crazycar\Debug\res\ammo.bmp

?????文件????1259768??2013-07-09?20:11??crazycar\Debug\res\bg.bmp

?????文件???????7656??2013-07-14?15:30??crazycar\Debug\res\blueObs.bmp

?????文件???????1496??2013-07-09?19:57??crazycar\Debug\res\bullet.bmp

?????文件???????1014??2013-07-11?21:42??crazycar\Debug\res\bulletshow.bmp

?????文件???????7656??2013-07-13?22:39??crazycar\Debug\res\car.bmp

?????文件??????36054??2013-07-11?16:03??crazycar\Debug\res\direction.bmp

?????文件???????5576??2013-07-10?19:48??crazycar\Debug\res\energy.bmp

?????文件?????351848??2012-06-04?09:19??crazycar\Debug\res\explosion.bmp

?????文件?????307512??2003-04-09?21:10??crazycar\Debug\res\gameover.bmp

?????文件?????230454??2013-07-14?21:26??crazycar\Debug\res\gamewin.bmp

?????文件????????774??2013-07-11?22:02??crazycar\Debug\res\life.bmp

?????文件???????9656??2013-07-14?16:26??crazycar\Debug\res\obstacle.bmp

?????文件??????87096??2013-07-14?19:25??crazycar\Debug\res\plane.bmp

?????文件??????14456??2013-07-14?20:10??crazycar\Debug\res\planeammo.bmp

?????文件??????14456??2013-07-14?19:42??crazycar\Debug\res\planelife.bmp

?????文件??????14456??2013-07-14?20:07??crazycar\Debug\res\planequick.bmp

?????文件??????14456??2013-07-14?20:04??crazycar\Debug\res\planetime.bmp

............此處省略58個文件信息

評論

共有 條評論