提交 cb083ac0 编辑于 作者: CjhGm's avatar CjhGm
浏览文件

reconstruct

上级 a9486dba
...@@ -402,27 +402,26 @@ void CAircraftBattleView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) ...@@ -402,27 +402,26 @@ void CAircraftBattleView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
else if (!isOver) { else if (!isOver) {
if (myplane != NULL && GetKeyState(VK_SPACE) < 0) { if (myplane != NULL && GetKeyState(VK_SPACE) < 0) {
// 按空格键发射子弹 // 按空格键发射子弹
CBullet* bullet1, *bullet2, *bullet3; CBullet* bullet1, * bullet2, * bullet3;
bullet1 = bullet2 = bullet3 = nullptr; bullet1 = bullet2 = bullet3 = nullptr;
switch (myScore / 100) { if (myScore < 100) {
case 0: bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true); bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true);
bulletList.AddTail(bullet1); bulletList.AddTail(bullet1);
break; }
case 1: bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 - 10, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true); else if (myScore < 300) {
bullet2 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 + 10, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true); bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 - 15, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true);
bullet2 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 + 15, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true);
bulletList.AddTail(bullet1); bulletList.AddTail(bullet1);
bulletList.AddTail(bullet2); bulletList.AddTail(bullet2);
break; }
default:bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true); else {
bullet2 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 - 5, myplane->GetPoint().y, myplane->getDamage(), 10, 30, true); bullet1 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true);
bullet3 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 + 5, myplane->GetPoint().y, myplane->getDamage(), -10, 30, true); bullet2 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 - 10, myplane->GetPoint().y, myplane->getDamage(), 10, 30, true);
bullet3 = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2 + 10, myplane->GetPoint().y, myplane->getDamage(), -10, 30, true);
bulletList.AddTail(bullet1); bulletList.AddTail(bullet1);
bulletList.AddTail(bullet2); bulletList.AddTail(bullet2);
bulletList.AddTail(bullet3); bulletList.AddTail(bullet3);
break;
} }
CBullet* bullet = new CBullet(myplane->GetPoint().x + PLANE_WIDTH / 2 - BULLET_WIDTH / 2, myplane->GetPoint().y, myplane->getDamage(), 0, 30, true);
bulletList.AddTail(bullet);
} }
} }
else { else {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define ENEMY_HEIGHT 90 // 敌机的高度 #define ENEMY_HEIGHT 90 // 敌机的高度
#define ENEMY_WIDTH 120 // 敌机的宽度 #define ENEMY_WIDTH 120 // 敌机的宽度
#define ENEMY_SPEED 3 // 敌机飞行速度 #define ENEMY_SPEED 3 // 敌机飞行速度
#define ENEMY_HP 1 // 敌机血量 #define ENEMY_HP 2 // 敌机血量
#define ENEMY_DAMAGE 1 // 敌机伤害 #define ENEMY_DAMAGE 1 // 敌机伤害
#define ENEMY_SCORE 10 // 敌机分数 #define ENEMY_SCORE 10 // 敌机分数
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册