資源簡介
用C++寫的一個控制臺版本的坦克大戰游戲,支持單雙人對戰,可以自己編輯地圖,有存檔讀檔功能,有一個小小的bug,在兩顆敵方子彈在同一個地方坦克體內碰撞后有1/2概率被固定在原地,bug觸發幾率很低,沒有碰到過,只是我自己想到的,有碰撞檢測,經過反復測試,碰撞檢測無bug
代碼片段和文件信息
#include“Bulletbase.h“
#include?“NameManager.h“
#include?“Map.h“
#include?“PrintCtrl.h“
#include?“Game.h“
void?CBullet::Move()?{
if(Thisgame->cGameMap[cPositionx?/?2][cPositiony]?4||?Thisgame->cGameMap[cPositionx?/?2][cPositiony]>29)
MapReair(cPositionx?cPositiony);
switch?(cDirection)
{
case?UP:cPositiony--;
break;
case?DOWN:cPositiony++;
break;
case?LEFT:cPositionx?-=?2;
break;
case?RIGHT:cPositionx?+=?2;
break;
}
}
void?CBullet::DrawSelf()?{
if?(Thisgame->cGameMap[cPositionx?/?2][cPositiony]<3)
{
Thisgame->cGameMap[cPositionx?/?2][cPositiony]?+=?(cNumber?*?3?+?30);
}
if?(bIsHide)
{
return;
}
else?{?PrintScreen(cPositionx?cPositiony?“◎“?cColor);?}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1470??2019-07-30?19:57??C++坦克大戰Test.sln
????..A..H.????133120??2019-08-23?20:26??.vs\C++坦克大戰Test\v15\.suo
?????文件???60747776??2019-08-23?20:26??.vs\C++坦克大戰Test\v15\Browse.VC.db
?????文件????????731??2019-08-22?21:13??C++坦克大戰Test\Bullet.cpp
?????文件????????787??2019-08-23?10:44??C++坦克大戰Test\Bulletba
?????文件???????7270??2019-08-22?13:55??C++坦克大戰Test\C++坦克大戰Test.vcxproj
?????文件???????3458??2019-08-22?13:55??C++坦克大戰Test\C++坦克大戰Test.vcxproj.filters
?????文件????????165??2019-07-30?19:57??C++坦克大戰Test\C++坦克大戰Test.vcxproj.user
?????文件???????2912??2019-08-23?20:18??C++坦克大戰Test\DoubleGame.cpp
?????文件????????313??2019-08-23?15:49??C++坦克大戰Test\DoubleGame.h
?????文件???????2247??2019-08-23?08:14??C++坦克大戰Test\EnemyBullet.cpp
?????文件????????290??2019-08-23?10:44??C++坦克大戰Test\EnemyBullet.h
?????文件???????2428??2019-08-23?20:26??C++坦克大戰Test\EnemyTank.cpp
?????文件????????578??2019-08-23?18:08??C++坦克大戰Test\EnemyTank.h
?????文件???????4434??2019-08-23?19:26??C++坦克大戰Test\Engine.cpp
?????文件????????523??2019-08-23?08:28??C++坦克大戰Test\Engine.h
?????文件???????5772??2019-08-23?19:59??C++坦克大戰Test\Game.cpp
?????文件???????1325??2019-08-23?18:55??C++坦克大戰Test\Game.h
?????文件???????9710??2019-08-23?20:11??C++坦克大戰Test\GamePrepare.cpp
?????文件????????530??2019-08-23?15:49??C++坦克大戰Test\GamePrepare.h
?????文件???????6715??2019-08-23?19:33??C++坦克大戰Test\Map.cpp
?????文件????????604??2019-08-22?18:32??C++坦克大戰Test\Map.h
?????文件???????1529??2019-08-23?18:55??C++坦克大戰Test\NameManager.h
?????文件???????2295??2019-08-23?19:19??C++坦克大戰Test\PlayBullet.cpp
?????文件????????290??2019-08-22?20:43??C++坦克大戰Test\Pla
?????文件???????1396??2019-08-23?19:05??C++坦克大戰Test\Pla
?????文件????????339??2019-08-23?18:55??C++坦克大戰Test\Pla
?????文件???????2645??2019-08-22?18:32??C++坦克大戰Test\PrintCtrl.cpp
?????文件???????1676??2019-08-22?18:32??C++坦克大戰Test\PrintCtrl.h
?????文件???????1912??2019-08-23?20:18??C++坦克大戰Test\SingleGame.cpp
............此處省略39個文件信息
- 上一篇:《實用數值計算方法》甄西豐 全部源碼 C語言
- 下一篇:VC++6.0中文破解版
評論
共有 條評論