diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..3bd9366 --- /dev/null +++ b/readme.txt @@ -0,0 +1,2 @@ +v16: 添加了全局背景音效 +v17: 修改了一点bug,在返回菜单后调用InitMap(),避免再次进入游戏界面时有脏数据导致显示出错 \ No newline at end of file diff --git a/tank_battles_on_the_scrap_paper.sln b/tank_battles_on_the_scrap_paper.sln new file mode 100644 index 0000000..aa28c4a --- /dev/null +++ b/tank_battles_on_the_scrap_paper.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tank_battles_on_the_scrap_paper", "tank_battles_on_the_scrap_paper\tank_battles_on_the_scrap_paper.vcxproj", "{AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Debug|x64.ActiveCfg = Debug|x64 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Debug|x64.Build.0 = Debug|x64 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Debug|x86.ActiveCfg = Debug|Win32 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Debug|x86.Build.0 = Debug|Win32 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Release|x64.ActiveCfg = Release|x64 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Release|x64.Build.0 = Release|x64 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Release|x86.ActiveCfg = Release|Win32 + {AC8C4A04-1650-473C-8E9A-3B7CDE2AD5CC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4E9B74CF-EE0B-430C-8380-34BE94639065} + EndGlobalSection +EndGlobal diff --git a/tank_battles_on_the_scrap_paper/bullet.h b/tank_battles_on_the_scrap_paper/bullet.h new file mode 100644 index 0000000..653f5b3 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/bullet.h @@ -0,0 +1,24 @@ +// ӵ +#ifndef BULLET_H +#define BULLET_H + +/* + ӵ + ӵ꣺xy + damageʾǰӵɵ˺ + ־is_alive + dir + UP + DOWN + LEFT + RIGHT +*/ +struct bullet { + int x, y; + int damage; // ӵ + int dir; + bool is_live; // Ƿ + //tank shooter; //ֵΪenemies[i]player +}; + +#endif // !BULLET_H \ No newline at end of file diff --git a/tank_battles_on_the_scrap_paper/data_config.h b/tank_battles_on_the_scrap_paper/data_config.h new file mode 100644 index 0000000..60ee9ec --- /dev/null +++ b/tank_battles_on_the_scrap_paper/data_config.h @@ -0,0 +1,52 @@ +// ö +#ifndef DATA_CONFIG_H +#define DATA_CONFIG_H +// tank bullet ͷļ +#include "tank.h" +#include "bullet.h" + +// +const int CELL_SIZE = 30; // ÿԪ̹ˡǽյصȣĴС磺أ +const int MAP_CELL_NUM = 20; // ͼСΪMAP_CELL_NUM^2 +const int ENEMIES_NUM = 10; // ͼĵ +const int BULLET_NUM = 20; // ͼӵ +const int SINGLE_BULLET = 3; // ÿ̹ͬʱڵӵ +const int White = 0; // Ҷͼ- +const int Black = 1; // Ҷͼ- + +#define PIEXL1 30 //س +#define PIEXL2 4 +#define X_OFFSET 50 //ϵһǽΪ׼ƫ +#define Y_OFFSET 45 //ϵһǽΪ׼ƫ +/* + ͼ + ʹ洢ͼϢ + map[x][y] 洢ǰ̹Ϣ + BLANK յ + RED_TANK 췽̹ + RED_DEAD_TANK 췽̹ + BLUE_TANK, ̹ + BLUE_DEAD_TANK ̹ + WALL ǽ + BULLET ӵ +*/ +enum CELL_Type { + BLANK, // յ + RED_TANK, // 췽̹ + RED_DEAD_TANK, // 췽̹ + BLUE_TANK, // ̹ + BLUE_DEAD_TANK, // ̹ + WALL, // ǽ + BULLET, // ӵ +}; +int map[MAP_CELL_NUM][MAP_CELL_NUM]; //map.hԤ + +int kill = 5; //ɱ +tank player; // +tank enemies[ENEMIES_NUM]; // +bullet E_bullets[BULLET_NUM * ENEMIES_NUM]; //з̹ӵ +bullet P_bullets[BULLET_NUM]; //ӵ + +tank enemy; // ڸĵ˵ԣѶõ + +#endif // !DATA_CONFIG_H \ No newline at end of file diff --git a/tank_battles_on_the_scrap_paper/images/B_DOWN.png b/tank_battles_on_the_scrap_paper/images/B_DOWN.png new file mode 100644 index 0000000..f1289a6 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_DOWN.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_DOWN_b.png b/tank_battles_on_the_scrap_paper/images/B_DOWN_b.png new file mode 100644 index 0000000..777872f Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_DOWN_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_DOWN_w.png b/tank_battles_on_the_scrap_paper/images/B_DOWN_w.png new file mode 100644 index 0000000..c7cc60f Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_DOWN_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_LEFT_b.png b/tank_battles_on_the_scrap_paper/images/B_LEFT_b.png new file mode 100644 index 0000000..7b4317e Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_LEFT_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_LEFT_w.png b/tank_battles_on_the_scrap_paper/images/B_LEFT_w.png new file mode 100644 index 0000000..7c6706b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_LEFT_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_RIGHT_b.png b/tank_battles_on_the_scrap_paper/images/B_RIGHT_b.png new file mode 100644 index 0000000..fe4a966 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_RIGHT_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_RIGHT_w.png b/tank_battles_on_the_scrap_paper/images/B_RIGHT_w.png new file mode 100644 index 0000000..3886a2b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_RIGHT_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_UP_b.png b/tank_battles_on_the_scrap_paper/images/B_UP_b.png new file mode 100644 index 0000000..285e644 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_UP_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/B_UP_w.png b/tank_battles_on_the_scrap_paper/images/B_UP_w.png new file mode 100644 index 0000000..e49990c Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/B_UP_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_down.png b/tank_battles_on_the_scrap_paper/images/blue_down.png new file mode 100644 index 0000000..0886bf4 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_down.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_down_b.png b/tank_battles_on_the_scrap_paper/images/blue_down_b.png new file mode 100644 index 0000000..7bcdb77 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_down_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_down_w.png b/tank_battles_on_the_scrap_paper/images/blue_down_w.png new file mode 100644 index 0000000..1f1f1f7 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_down_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_left.png b/tank_battles_on_the_scrap_paper/images/blue_left.png new file mode 100644 index 0000000..a06c783 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_left.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_left_b.png b/tank_battles_on_the_scrap_paper/images/blue_left_b.png new file mode 100644 index 0000000..59bd323 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_left_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_left_w.png b/tank_battles_on_the_scrap_paper/images/blue_left_w.png new file mode 100644 index 0000000..2fc6cd2 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_left_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_right.png b/tank_battles_on_the_scrap_paper/images/blue_right.png new file mode 100644 index 0000000..0e796f5 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_right.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_right_b.png b/tank_battles_on_the_scrap_paper/images/blue_right_b.png new file mode 100644 index 0000000..59c121b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_right_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_right_w.png b/tank_battles_on_the_scrap_paper/images/blue_right_w.png new file mode 100644 index 0000000..b51ddbb Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_right_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_up.png b/tank_battles_on_the_scrap_paper/images/blue_up.png new file mode 100644 index 0000000..61068d8 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_up.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_up_b.png b/tank_battles_on_the_scrap_paper/images/blue_up_b.png new file mode 100644 index 0000000..5c92def Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_up_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/blue_up_w.png b/tank_battles_on_the_scrap_paper/images/blue_up_w.png new file mode 100644 index 0000000..44236ef Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/blue_up_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/bullet.png b/tank_battles_on_the_scrap_paper/images/bullet.png new file mode 100644 index 0000000..a433d4a Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/bullet.png differ diff --git a/tank_battles_on_the_scrap_paper/images/dead_tank.png b/tank_battles_on_the_scrap_paper/images/dead_tank.png new file mode 100644 index 0000000..28653a6 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/dead_tank.png differ diff --git a/tank_battles_on_the_scrap_paper/images/dead_tank_b.png b/tank_battles_on_the_scrap_paper/images/dead_tank_b.png new file mode 100644 index 0000000..a2e598a Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/dead_tank_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/dead_tank_w.png b/tank_battles_on_the_scrap_paper/images/dead_tank_w.png new file mode 100644 index 0000000..f58615b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/dead_tank_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_down.png b/tank_battles_on_the_scrap_paper/images/red_down.png new file mode 100644 index 0000000..ee94744 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_down.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_down_b.png b/tank_battles_on_the_scrap_paper/images/red_down_b.png new file mode 100644 index 0000000..920d512 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_down_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_down_w.png b/tank_battles_on_the_scrap_paper/images/red_down_w.png new file mode 100644 index 0000000..8f0836a Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_down_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_hp_bar - 副本.jpg b/tank_battles_on_the_scrap_paper/images/red_hp_bar - 副本.jpg new file mode 100644 index 0000000..e6d7d0f Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_hp_bar - 副本.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/red_hp_bar.jpg b/tank_battles_on_the_scrap_paper/images/red_hp_bar.jpg new file mode 100644 index 0000000..b97349c Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_hp_bar.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/red_left.png b/tank_battles_on_the_scrap_paper/images/red_left.png new file mode 100644 index 0000000..708af7a Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_left.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_left_b.png b/tank_battles_on_the_scrap_paper/images/red_left_b.png new file mode 100644 index 0000000..150f9c1 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_left_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_left_w.png b/tank_battles_on_the_scrap_paper/images/red_left_w.png new file mode 100644 index 0000000..0bc7dcb Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_left_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_right.png b/tank_battles_on_the_scrap_paper/images/red_right.png new file mode 100644 index 0000000..c524625 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_right.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_right_b.png b/tank_battles_on_the_scrap_paper/images/red_right_b.png new file mode 100644 index 0000000..bbcad73 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_right_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_right_w.png b/tank_battles_on_the_scrap_paper/images/red_right_w.png new file mode 100644 index 0000000..52ac72e Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_right_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_up - 副本.png b/tank_battles_on_the_scrap_paper/images/red_up - 副本.png new file mode 100644 index 0000000..8db0e2b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_up - 副本.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_up.jpg b/tank_battles_on_the_scrap_paper/images/red_up.jpg new file mode 100644 index 0000000..35ae9e5 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_up.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/red_up.png b/tank_battles_on_the_scrap_paper/images/red_up.png new file mode 100644 index 0000000..2bf9a7b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_up.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_up_b.png b/tank_battles_on_the_scrap_paper/images/red_up_b.png new file mode 100644 index 0000000..59a2669 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_up_b.png differ diff --git a/tank_battles_on_the_scrap_paper/images/red_up_w.png b/tank_battles_on_the_scrap_paper/images/red_up_w.png new file mode 100644 index 0000000..5b80a8c Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/red_up_w.png differ diff --git a/tank_battles_on_the_scrap_paper/images/wall - 副本.jpg b/tank_battles_on_the_scrap_paper/images/wall - 副本.jpg new file mode 100644 index 0000000..0b0c678 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/wall - 副本.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/wall.jpg b/tank_battles_on_the_scrap_paper/images/wall.jpg new file mode 100644 index 0000000..caf5c65 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/wall.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/中等难度.jpg b/tank_battles_on_the_scrap_paper/images/中等难度.jpg new file mode 100644 index 0000000..1bcadbc Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/中等难度.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/困难难度.jpg b/tank_battles_on_the_scrap_paper/images/困难难度.jpg new file mode 100644 index 0000000..9d8b44f Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/困难难度.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/失败.png b/tank_battles_on_the_scrap_paper/images/失败.png new file mode 100644 index 0000000..478dd3e Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/失败.png differ diff --git a/tank_battles_on_the_scrap_paper/images/开始游戏按键.jpg b/tank_battles_on_the_scrap_paper/images/开始游戏按键.jpg new file mode 100644 index 0000000..1849e1b Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/开始游戏按键.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/游戏主界面背景.jpg b/tank_battles_on_the_scrap_paper/images/游戏主界面背景.jpg new file mode 100644 index 0000000..e3eed69 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/游戏主界面背景.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/相关人员按键.jpg b/tank_battles_on_the_scrap_paper/images/相关人员按键.jpg new file mode 100644 index 0000000..e80db93 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/相关人员按键.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/相关人员界面.jpg b/tank_battles_on_the_scrap_paper/images/相关人员界面.jpg new file mode 100644 index 0000000..5033528 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/相关人员界面.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/示例页面/blank.jpg b/tank_battles_on_the_scrap_paper/images/示例页面/blank.jpg new file mode 100644 index 0000000..1c86ca3 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/示例页面/blank.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/示例页面/游戏主界面原型图.jpg b/tank_battles_on_the_scrap_paper/images/示例页面/游戏主界面原型图.jpg new file mode 100644 index 0000000..9ce952c Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/示例页面/游戏主界面原型图.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/示例页面/菜单页设计示例v2.jpeg b/tank_battles_on_the_scrap_paper/images/示例页面/菜单页设计示例v2.jpeg new file mode 100644 index 0000000..79b1c69 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/示例页面/菜单页设计示例v2.jpeg differ diff --git a/tank_battles_on_the_scrap_paper/images/简单难度.jpg b/tank_battles_on_the_scrap_paper/images/简单难度.jpg new file mode 100644 index 0000000..280f2f9 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/简单难度.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/胜利.png b/tank_battles_on_the_scrap_paper/images/胜利.png new file mode 100644 index 0000000..953bc09 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/胜利.png differ diff --git a/tank_battles_on_the_scrap_paper/images/菜单界面.jpg b/tank_battles_on_the_scrap_paper/images/菜单界面.jpg new file mode 100644 index 0000000..571f6f9 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/菜单界面.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/血量条和攻击力.png b/tank_battles_on_the_scrap_paper/images/血量条和攻击力.png new file mode 100644 index 0000000..4c28ab0 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/血量条和攻击力.png differ diff --git a/tank_battles_on_the_scrap_paper/images/返回按钮.jpg b/tank_battles_on_the_scrap_paper/images/返回按钮.jpg new file mode 100644 index 0000000..749476e Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/返回按钮.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/退出游戏按键.jpg b/tank_battles_on_the_scrap_paper/images/退出游戏按键.jpg new file mode 100644 index 0000000..2df79db Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/退出游戏按键.jpg differ diff --git a/tank_battles_on_the_scrap_paper/images/难度设置按键.jpg b/tank_battles_on_the_scrap_paper/images/难度设置按键.jpg new file mode 100644 index 0000000..7bd7fd8 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/images/难度设置按键.jpg differ diff --git a/tank_battles_on_the_scrap_paper/main.cpp b/tank_battles_on_the_scrap_paper/main.cpp new file mode 100644 index 0000000..479c5b4 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/main.cpp @@ -0,0 +1,1455 @@ +// Ŀֽϵ̹˴ս +#include +#include +#include +#include +#include +#include +#include +// data_config ͷļ +#include "data_config.h" +// #include "map.h" // Ԥͼͷļ +// #include "main.h" // 뺯ͷļ + +// -------- Ч -------- +#include"resource.h"//Դ֮һresource.hͷļ ǵü +#include +#include +#pragma comment(lib,"winmm.lib") + +using namespace std; + +void EnemyBulletMove(); +void PlayerBulletMove(); +int BulletMoveCheck(int dir, bullet bul); +void change(); +void EnemiesMove(); +void EnemyInit(); +void EnemyShoot(); +void GameView(); +void GameView_ShowBullet(); +void GameView_ShowLose(); +void GameView_ShowMap(); +void GameView_ShowTank(); +void GameView_ShowWIN(); +void InitMap(); +// void InitMap(const int preset_map[50][50]); +bool IsWin(); +void Level(); +void MemberView(); +void MenuView(); +void Move(); +void PlayerInit(); +void PlayerMove(); +void PlayerShoot(); +int TankMoveCheck(int dir, tank tank); +void Update(); + + +/* + ˵棺 + չʾϷѶȣ˳ѡ + ûͨwsѡӦİťس + + Ϸ + ѡϷͼʼͼ̹ + + Ѷȣ + öӦѶȽϷ + + ڿԱ + ҵҳ棬չʾԱ + + ˳Ϸ + ѡ˳Ϸ + + Ϸ + չʾͼ̹ˣҶ̹ԶƶͿ + wsadҷƶ + ¿ոԼǰڵ + УѪ + һ̹ˣϷ,ص˵ + + ͣ + չʾϷ˳ϷťͬʱϷͣ +*/ + +/* + + 1˵ + 2˵Ϸ + 3Ϸͣ + 4ͣò˵ +*/ + +//-----------------view------------------------ +/* + ˣ + ܣչʾϷѶȣ˳ѡ, + Ϸ + ѡϷʱϷ溯ֱӽϷ + Ѷȣ + ѡѶʱҳ溯з̹ѪԼ仯ĺݡ + ֮Ҫesc˵ȻɽϷ + ˳Ϸ + ѡ˳ʱ˳ֱӽϷ + ǣ + չʾŶϢ + // Ϸеʼҳ +*/ +void MenuView(); + +/* +* Ϸ + ˣunder a bushel + ܣ +*/ +// ÿһΣͼͼÿһ״̬ +// һµͼϽӣ̹˺ӵ꣺λúͷ +void GameView() //Ϸͼ +{ + InitMap(); //ʼͼ + // InitMap(map1); //ʼͼ + EnemyInit(); //ʼз̹˵λ + PlayerInit(); //ʼ̹˵λ + + GameView_ShowMap(); //ʾͼ + GameView_ShowTank(); //ʾ̹ + + while (!IsWin()) // Ϸûʤ + { + if (player.hp <= 0) //жҵֵǷСڻ 0 + { + GameView_ShowLose(); // failView ʾʧͼ + /*MenuView();*/ //ص˵ + break; + } + + if (GetAsyncKeyState(VK_ESCAPE)) //ûļ¼ǷΪ ESC + { + MenuView(); // menuView ص˵ + } + + Move(); // MoveShoot Update ЩҪʵ̹˺ӵƶ״̬¡ + // + if(GetAsyncKeyState(VK_SPACE)) + PlayerShoot(); + EnemyShoot(); + // Update(); + Update(); + GameView_ShowMap(); //ʾͼ״̬ + GameView_ShowBullet(); //ʾӵ״̬ + GameView_ShowTank(); //ʾ̹˵״̬ + } + + if (IsWin()) //Ϸʤ winView ʾʤͼص˵档 + { + GameView_ShowWIN(); + /*MenuView();*/ + } +} + +/* + :Ӻˮ + + жӵǷﵽޣ0-3ֱӱ0-3ҵһis_live == false,break + ģӵʼ +*/ +void PlayerShoot() +{ + static clock_t start = clock() - 500; + if ((clock() - start) < 500) + return; + start = clock(); + for (int i = 0; i < SINGLE_BULLET; i++) + { + if (P_bullets[i].is_live == false) + { + //ʼӵ + P_bullets[i].x = player.x; + P_bullets[i].y = player.y; + P_bullets[i].dir = player.dir; + P_bullets[i].damage = player.attack; + P_bullets[i].is_live = true; + break; + } + } +} + +/* + :Ӻˮ + 룺˽ṹ + ˷ӵԶ,̹ + жǷҪ䣬%2,01 + if Ҫ ӵ +*/ +void EnemyShoot() +{ + static clock_t start = clock() - 3000; + if ((clock() - start) < 3000) + return; + start = clock(); + for (int i = 0; i < ENEMIES_NUM; i++) //е̹ + { + if (enemies[i].hp > 0) { + for (auto& j : E_bullets) + { + if (j.is_live == false) //ֻҪһӵڣ䣬ŶѾڣ򲻷ӵ + { + j.x = enemies[i].x; + j.y = enemies[i].y; + j.dir = enemies[i].dir; + j.damage = enemy.attack; + j.is_live = true; + break; + } + } + } + } +} + +/* + :Ӻˮ + ܣ + ƶӵƶӵĿĴײ +*/ +void Move() +{ + bool move = false; + if (GetAsyncKeyState('W') || GetAsyncKeyState(VK_UP)) + { + player.dir = UP; + move = true; + } + else if (GetAsyncKeyState('S') || GetAsyncKeyState(VK_DOWN)) + { + player.dir = DOWN; + move = true; + } + else if (GetAsyncKeyState('A') || GetAsyncKeyState(VK_LEFT)) + { + player.dir = LEFT; + move = true; + } + else if (GetAsyncKeyState('D') || GetAsyncKeyState(VK_RIGHT)) + { + player.dir = RIGHT; + move = true; + };//ķ + + + + if (move) { + PlayerMove(); //player.dir ȫֱô + } + EnemiesMove(); //ƶ + PlayerBulletMove(); + EnemyBulletMove(); +} + +///* +//* ҷǰһǿյ +//*/ +//bool PlayerCollision(); + + +/* + ˣС yang + ܣ + mapɵͼ +*/ +void GameView_ShowMap() // ̹ȫֵģҪ +//void GameView_ShowMap(tank player) +{ + // ˫ + setbkmode(TRANSPARENT); // ñ͸ + BeginBatchDraw(); // ʼͼ + + //ȡͼƬ + //·ȷȷΨһ ------ + IMAGE image_WALL, image_back, image_RED_HP; + // IMAGE image_WALL, image_back, image_RED_HP, image_BLUE_HP; + loadimage(&image_WALL, ".//images//wall.jpg", CELL_SIZE, CELL_SIZE); + loadimage(&image_back, ".//images//Ϸ汳.jpg", 700, 700); + loadimage(&image_RED_HP, ".//images//red_hp_bar.jpg", CELL_SIZE, CELL_SIZE); + // loadimage(&image_BLUE_HP, ".//images//blue_hp.jpg", 30, 30); // version1汾ĿǰзѪ + + //Ⱦ + putimage(0, 0, &image_back); + + //췽̹HPȾ + for (int i = 0; i < player.hp; i++) + { + putimage(100 + i * 30 , 10, &image_RED_HP); + } + + ////̹HPȾ + //for (int j = 0; j < player.hp; j++) + //{ + // putimage(570 - j * 30, 120, &image_RED_HP); + //} + + int dieNum = 0; + for (auto& i : enemies) { + if (i.hp <= 0) dieNum++; + } + //ʾʵʱȾ + settextcolor((157, 157, 157)); + settextstyle(30, 0, ""); + outtextxy(110, 660, "ܣ"); + outtextxy(185, 660, to_string(dieNum).data()); + outtextxy(210, 660, "/"); + outtextxy(225, 660, "10"); + + outtextxy(325, 660, string("" + to_string(player.attack)).data()); + + + //ǽȾ + for (int i = 0; i < MAP_CELL_NUM; i++) + { + for (int j = 0; j < MAP_CELL_NUM; j++) + { + if (map[i][j] == WALL) + { + putimage(j * CELL_SIZE + X_OFFSET, i * CELL_SIZE + Y_OFFSET, &image_WALL); + } + } + } +} + + +/* + ˣ + ܣڵͼ +*/ +// void GameView_ShowBullet(); +// void GameView_ShowBullet(bullet b); + +/* + ˣС yang + ܣ̹ͼ + +*/ +void GameView_ShowTank() +// void GameView_ShowTank(tank player, tank enemies[]) +{ + // ˫ + setbkmode(TRANSPARENT); // ñ͸ + BeginBatchDraw(); // ʼͼ + + //̹ͼƬ + IMAGE image_REDtank_UP[2], image_REDtank_DOWN[2], image_REDtank_LEFT[2], image_REDtank_RIGHT[2], + + image_BLUEtank_UP[2], image_BLUEtank_DOWN[2], image_BLUEtank_LEFT[2], image_BLUEtank_RIGHT[2], + + image_BLUE_DEADtank[2]; + + //صͼ + //·ȷȷΨһ ------ + + loadimage(&image_REDtank_DOWN[White], ".//images//red_down_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_REDtank_DOWN[Black], ".//images//red_down_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_REDtank_UP[White], ".//images//red_up_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_REDtank_UP[Black], ".//images//red_up_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_REDtank_LEFT[White], ".//images//red_left_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_REDtank_LEFT[Black], ".//images//red_left_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_REDtank_RIGHT[White], ".//images//red_right_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_REDtank_RIGHT[Black], ".//images//red_right_b.png", CELL_SIZE, CELL_SIZE); + + + loadimage(&image_BLUEtank_UP[White], ".//images//blue_up_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_BLUEtank_UP[Black], ".//images//blue_up_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_BLUEtank_DOWN[White], ".//images//blue_down_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_BLUEtank_DOWN[Black], ".//images//blue_down_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_BLUEtank_LEFT[White], ".//images//blue_left_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_BLUEtank_LEFT[Black], ".//images//blue_left_b.png", CELL_SIZE, CELL_SIZE); + + loadimage(&image_BLUEtank_RIGHT[White], ".//images//blue_right_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_BLUEtank_RIGHT[Black], ".//images//blue_right_b.png", CELL_SIZE, CELL_SIZE); + + // loadimage(&image_RED_DEADtank, "./̹.png", CELL_SIZE, CELL_SIZE); // ̹˱ϺζϷֱӵϷʧҳ棬˲ҪʾԼı״̬ + loadimage(&image_BLUE_DEADtank[White], ".//images//dead_tank_w.png", CELL_SIZE, CELL_SIZE); + loadimage(&image_BLUE_DEADtank[Black], ".//images//dead_tank_b.png", CELL_SIZE, CELL_SIZE); + //loadimage(&image_BLANK, ".//images//blank.jpg", CELL_SIZE, CELL_SIZE); + + + + + //ȾͼԪ + for (int i = 0; i < MAP_CELL_NUM; i++) + { + for (int j = 0; j < MAP_CELL_NUM; j++) + { + //if (map[i][j] == BLANK) + //{ + // putimage(j * CELL_SIZE + X_OFFSET, i * CELL_SIZE + Y_OFFSET, &image_BLANK); // ͼ + //} + + if ((map[i][j] == RED_TANK && player.dir == LEFT)) + { + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_LEFT[White], SRCAND); + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_LEFT[Black], SRCPAINT); + } + + if (map[i][j] == RED_TANK && player.dir == RIGHT) + { + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_RIGHT[White], SRCAND); + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_RIGHT[Black], SRCPAINT); + } + + if (map[i][j] == RED_TANK && player.dir == DOWN) + { + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_DOWN[White], SRCAND); + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_DOWN[Black], SRCPAINT); + } + + if (map[i][j] == RED_TANK && player.dir == UP) + { + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_UP[White], SRCAND); + putimage(player.x * CELL_SIZE + X_OFFSET, player.y * CELL_SIZE + Y_OFFSET, &image_REDtank_UP[Black], SRCPAINT); + } + + //if (map[i][j] == RED_DEAD_TANK) + //{ + + // putimage(j * CELL_SIZE + X_OFFSET, i * CELL_SIZE + Y_OFFSET, &image_RED_DEADtank); + //} + } + } + + //Ⱦ̹ + for (int i = 0; i < ENEMIES_NUM; i++) + { + if (enemies[i].is_taken) + continue; + if (enemies[i].hp > 0) { + switch (enemies[i].dir) + { + case UP: + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_UP[White], SRCAND); + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_UP[Black], SRCPAINT); + break; + case DOWN: + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_DOWN[White], SRCAND); + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_DOWN[Black], SRCPAINT); + break; + case LEFT: + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_LEFT[White], SRCAND); + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_LEFT[Black], SRCPAINT); + break; + case RIGHT: + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_RIGHT[White], SRCAND); + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUEtank_RIGHT[Black], SRCPAINT); + break; + default: + break; + } + } + else { + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUE_DEADtank[White], SRCAND); + putimage(enemies[i].x * CELL_SIZE + X_OFFSET, enemies[i].y * CELL_SIZE + Y_OFFSET, &image_BLUE_DEADtank[Black], SRCPAINT); + } + } + + // ͼʾͼ + EndBatchDraw(); // ͼ +} + + +IMAGE image_BULLET[4][2]; + +void GameView_ShowBullet() +{ + bool b = true; + if (b) { + b = false; + loadimage(&image_BULLET[UP][White], ".//images//B_UP_w.png", CELL_SIZE / 2 / 2, CELL_SIZE / 2); + loadimage(&image_BULLET[UP][Black], ".//images//B_UP_b.png", CELL_SIZE / 2 / 2, CELL_SIZE / 2); + loadimage(&image_BULLET[DOWN][White], ".//images//B_DOWN_w.png", CELL_SIZE / 2 / 2, CELL_SIZE / 2); + loadimage(&image_BULLET[DOWN][Black], ".//images//B_DOWN_b.png", CELL_SIZE / 2 / 2, CELL_SIZE / 2); + loadimage(&image_BULLET[LEFT][White], ".//images//B_LEFT_w.png", CELL_SIZE / 2, CELL_SIZE / 2 / 2); + loadimage(&image_BULLET[LEFT][Black], ".//images//B_LEFT_b.png", CELL_SIZE / 2, CELL_SIZE / 2 / 2); + loadimage(&image_BULLET[RIGHT][White], ".//images//B_RIGHT_w.png", CELL_SIZE / 2, CELL_SIZE / 2 / 2); + loadimage(&image_BULLET[RIGHT][Black], ".//images//B_RIGHT_b.png", CELL_SIZE / 2, CELL_SIZE / 2 / 2); + } + for (int i = 0; i < BULLET_NUM; i++) { //ӵ + if (P_bullets[i].is_live) { + int x = P_bullets[i].x * CELL_SIZE + X_OFFSET; + int y = P_bullets[i].y * CELL_SIZE + Y_OFFSET; + putimage((P_bullets[i].dir > DOWN ? x : x + 10.5), (P_bullets[i].dir > DOWN ? y + 10.5 : y), &image_BULLET[P_bullets[i].dir][White], SRCAND); + putimage((P_bullets[i].dir > DOWN ? x : x + 10.5), (P_bullets[i].dir > DOWN ? y + 10.5 : y), &image_BULLET[P_bullets[i].dir][Black], SRCPAINT); + } + } + for (int i = 0; i < BULLET_NUM * ENEMIES_NUM; i++) { //Ƶзӵ + if (E_bullets[i].is_live) { + int x = E_bullets[i].x * CELL_SIZE + X_OFFSET; + int y = E_bullets[i].y * CELL_SIZE + Y_OFFSET; + putimage((E_bullets[i].dir > DOWN ? x : x + 10.5), (E_bullets[i].dir > DOWN ? y + 10.5 : y), &image_BULLET[E_bullets[i].dir][White], SRCAND); + putimage((E_bullets[i].dir > DOWN ? x : x + 10.5), (E_bullets[i].dir > DOWN ? y + 10.5 : y), &image_BULLET[E_bullets[i].dir][Black], SRCPAINT); + } + } + + /*for (int i = 0; i < 50; i++) + { + for (int j = 0; j < 50; j++) + { + if (map[i][j] == BULLET && bullets[i].dir == UP) + { + putimage(j * PIEXL1 + X + (PIEXL1 - PIEXL2) / 2, i * PIEXL1 + (PIEXL1 - PIEXL2) / 2, &image_BULLET_UP); + } + if (map[i][j] == BULLET && BULLET.dir == DOWN) + { + putimage(j * PIEXL1 + X + (PIEXL1 - PIEXL2) / 2, i * PIEXL1 + (PIEXL1 - PIEXL2) / 2, &image_BULLET_DOWN); + } + if (map[i][j] == BULLET && BULLET.dir == RIGHT) + { + putimage(j * PIEXL1 + X + (PIEXL1 - PIEXL2) / 2, i * PIEXL1 + (PIEXL1 - PIEXL2) / 2, &image_BULLET_RIGHT); + } + if (map[i][j] == BULLET && BULLET.dir == LEFT) + { + putimage(j * PIEXL1 + X + (PIEXL1 - PIEXL2) / 2, i * PIEXL1 + (PIEXL1 - PIEXL2) / 2, &image_BULLET_LEFT); + } + } + }*/ +} + +/* + ˣ + ܣʤ +*/ +void GameView_ShowWIN() +{ + cleardevice(); + setbkmode(TRANSPARENT); + IMAGE img; + loadimage(&img, ".//images//ʤ.png", 700, 700); + putimage(0, 0, &img); + IMAGE img_back; + loadimage(&img_back, ".//images//ذť.jpg", 150, 50); + putimage(30, 550, &img_back); + // + ExMessage msg; + while (true) + { + //̲ + if (_kbhit()) + { + char key = _getch();//һֱ + //printf("%d,%c\n", key, key); + switch (key) + { + case 27://ϼ + //ز˵ + MenuView(); + //printf("ز˵/n"); + return; + break; + } + } + + // + if (peekmessage(&msg, WH_MOUSE)) + { + switch (msg.message) + { + case WM_LBUTTONDOWN: + + //ص˵ + if (msg.x >= 30 && msg.x <= 180 && msg.y >= 550 && msg.y <= 600) + { + MenuView(); + return; + //printf("ص˵\n"); + //תѶȽ + } + break; + default: + break; + } + } + } + //char s[] = "˵"; + //outtextxy(250, 400, s); + //_getch(); +} + +/* + ˣ + ܣʧܽ + +*/ + +void GameView_ShowLose() +{ + cleardevice(); + setbkmode(TRANSPARENT); + IMAGE img; + loadimage(&img, ".//images//ʧ.png", 700, 700); + putimage(0, 0, &img); + IMAGE img_back; + loadimage(&img_back, ".//images//ذť.jpg", 150, 50); + putimage(30, 550, &img_back); + // + ExMessage msg; + while (true) + { + //̲ + if (_kbhit()) + { + char key = _getch();//һֱ + //printf("%d,%c\n", key, key); + switch (key) + { + case 27://ϼ + //ز˵ + MenuView(); + //printf("ز˵/n"); + return; + break; + } + } + + // + if (peekmessage(&msg, WH_MOUSE)) + { + switch (msg.message) + { + case WM_LBUTTONDOWN: + + //ص˵ + if (msg.x >= 30 && msg.x <= 180 && msg.y >= 550 && msg.y <= 600) + { + MenuView(); + return; + //printf("ص˵\n"); + //תѶȽ + } + break; + default: + break; + } + } + } + //char s[] = "˵"; + //outtextxy(250, 400, s); + //_getch(); +} + +//------------------view------------------- + +//-------------------service--------------- + +/* +* ˢµͼ +*/ + void Update() +{ + InitMap(); //ԭеĵͼݸһmap + + map[player.x][player.y] = RED_TANK; //ҡˡӵ飬λϢд뵽ͼ + + for (int i = 0; i < ENEMIES_NUM; i++) { + if (enemies[i].hp > 0) { + map[enemies[i].x][enemies[i].y] = BLUE_TANK; + } + else if (enemies[i].hp <= 0 && enemies[i].is_taken == false) { + map[enemies[i].x][enemies[i].y] = BLUE_DEAD_TANK; + } + } + + //for (int j = 0; j < BULLET_NUM; j++) { //ӵ + // if (P_bullets[j].is_live == true) { + // map[enemies[j].x][enemies[j].y] = BULLET; + // } + //} + + //for (int k = 0; k < BULLET_NUM * ENEMIES_NUM; k++) { //зӵ + // if (E_bullets[k].is_live == true) { + // map[enemies[k].x][enemies[k].y] = BULLET; + // } + //} +} + +/* + ˣ + ܣʼΪǽĿհ׵ͼ +*/ +void InitMap() +{ + // ʼͼ + for (int i = 0; i < MAP_CELL_NUM; i++) { + for (int j = 0; j < MAP_CELL_NUM; j++) { + // ܵλã趨Ϊ WALL + if (i == 0 || i == MAP_CELL_NUM - 1 || j == 0 || j == MAP_CELL_NUM - 1) { + map[i][j] = WALL; + } + // λ趨Ϊ BLANK + else { + map[i][j] = BLANK; + } + } + } +} + +/* + ˣ + ܣչĵͼʼmap.hļͼ +*/ +//void InitMap(const int preset_map[MAP_CELL_NUM][MAP_CELL_NUM]) { +// for (int i = 0; i < MAP_CELL_NUM; i++) { +// for (int j = 0; j < MAP_CELL_NUM; j++) { +// map[i][j] = preset_map[i][j]; +// } +// } +//} + +/* + ˣɥɥ + ܣ + շж̹ƶĿ + ʵ̹ƶ +*/ +void PlayerMove() { + static clock_t start = clock() - 100; + if ((clock() - start) < 100) + return; + start = clock(); + if (player.dir == UP) { + switch (TankMoveCheck(player.dir, player)) { //յ,з̹,ӵ,з̹,ǽ + case BLANK: + player.y--; + break; + case BULLET: + player.y--; + player.hp--; + for (int i = 0; i <= BULLET_NUM * ENEMIES_NUM; i++) { //ҳĿӵ䱨 + if (E_bullets[i].x == player.x && E_bullets[i].y == player.y) { + E_bullets[i].is_live = false; + } + } + break; + case BLUE_DEAD_TANK: + player.y--; + player.attack++; + if(player.hp < 5) player.hp++; + for (int i = 0; i < ENEMIES_NUM; i++) { //ѭ̹ + if (player.x == enemies[i].x && player.y == enemies[i].y) //Ҹλ̹ + enemies[i].is_taken = true; + } + break; + default: + break; + } + + + } + else if (player.dir == DOWN) { + switch (TankMoveCheck(player.dir, player)) { //յ,з̹,ӵ,з̹,ǽ + case BLANK: + player.y++; + break; + case BULLET: + player.y++; + player.hp--; + for (int i = 0; i <= BULLET_NUM * ENEMIES_NUM; i++) { //ҳĿӵ䱨 + if (E_bullets[i].x == player.x && E_bullets[i].y == player.y) { + E_bullets[i].is_live = false; + } + } + break; + case BLUE_DEAD_TANK: + player.y++; + player.attack++; + if (player.hp < 5) player.hp++; + for (int i = 0; i < ENEMIES_NUM; i++) { //ѭ̹ + if (player.x == enemies[i].x && player.y == enemies[i].y) //Ҹλ̹ + enemies[i].is_taken = true; + } + break; + default: + break; + } + } + else if (player.dir == LEFT) { + switch (TankMoveCheck(player.dir, player)) { //յ,з̹,ӵ,з̹,ǽ + case BLANK: + player.x--; + break; + case BULLET: + player.x--; + player.hp--; + for (int i = 0; i <= BULLET_NUM * ENEMIES_NUM; i++) { //ҳĿӵ䱨 + if (E_bullets[i].x == player.x && E_bullets[i].y == player.y) { + E_bullets[i].is_live = false; + } + } + break; + case BLUE_DEAD_TANK: + player.x--; + player.attack++; + if (player.hp < 5) player.hp++; + for (int i = 0; i < ENEMIES_NUM; i++) { //ѭ̹ + if (player.x == enemies[i].x && player.y == enemies[i].y) //Ҹλ̹ + enemies[i].is_taken = true; + } + break; + default: + break; + } + } + else if (player.dir == RIGHT) { + switch (TankMoveCheck(player.dir, player)) { //յ,з̹,ӵ,з̹,ǽ + case BLANK: + player.x++; + break; + case BULLET: + player.x++; + player.hp--; + for (int i = 0; i <= BULLET_NUM * ENEMIES_NUM; i++) { //ҳĿӵ䱨 + if (E_bullets[i].x == player.x && E_bullets[i].y == player.y) { + E_bullets[i].is_live = false; + } + } + break; + case BLUE_DEAD_TANK: + player.x++; + player.attack++; + if (player.hp < 5) player.hp++; + for (int i = 0; i < ENEMIES_NUM; i++) { //ѭ̹ + if (player.x == enemies[i].x && player.y == enemies[i].y) //Ҹλ̹ + enemies[i].is_taken = true; + } + break; + default: + break; + } + } +}//ײǽ͵з̹̹˲ƶ޸ + +/* + ˣɥɥ + ܣ̹ײ⣺Ƿǽз̹ˡз̹ˡյ + ԲͬвͬĴ + 0->յء1->ʾǽ2->̹ˡ3->̹ˡ4->̹ + һλõ꣨player.dir㣩ʲô +*/ +int TankMoveCheck(int dir, tank tank) { //̹ܷƶ,ؼλô洢öֵ + int ret = 0; // ĬϷֵΪ 0 + switch (dir) { + case UP: + return map[tank.x][tank.y - 1]; + break; + case DOWN: + return map[tank.x][tank.y + 1]; + break; + case LEFT: + return map[tank.x - 1][tank.y]; + break; + case RIGHT: + return map[tank.x + 1][tank.y]; + break; + default: // ĬϷ֧ + break; + } + return ret; +} + +/* + ˣ + ܣӵ飬ÿһӵд + ȿ϶üĩ״̬λã12-1512131415 + ӵײ⣺Ƿǽз̹ˡз̹ˡӵзӵյء̹ˡ +*/ + +/* + ˣ +*/ +int BulletMoveCheck(int dir, bullet bul) //صǰĿmapֵ +{ + int ret = 0; // ĬϷֵΪ 0 + switch (dir) { + case UP: + return map[bul.x][bul.y - 1]; + break; + case DOWN: + return map[bul.x][bul.y + 1]; + break; + case LEFT: + return map[bul.x - 1][bul.y]; + break; + case RIGHT: + return map[bul.x + 1][bul.y]; + break; + default: // ĬϷ֧ + return ret; + break; + } +} + +/* + ˣɥɥ + ܣ + ƶwasd4ȡģ0123 + ֮-жһλõ״̬ȻӦ + ʱƶı䷽жϵƶĿʵֵƶ +*/ +void EnemiesMove() { //ؿ + static clock_t start = clock() - 1000; + if((clock() - start) < 1000) + return; + start = clock(); + for (int i = 0; i < ENEMIES_NUM; ++i) { //nз̹ƶ + if (enemies[i].hp <= 0) + continue; + int dir = rand() % 4; //ɵз̹˵ƶ + if (dir == UP) { //0 + enemies[i].dir = UP; // ǰ enemies[i] ķ + switch (TankMoveCheck(dir, enemies[i])) { //յ,з̹,ӵ,ǽ + case BLANK: + enemies[i].y--; + break; + case BULLET: + enemies[i].y--; + for (int i = 0; i < BULLET_NUM; i++) { //ӵ + if (P_bullets[i].x == enemies[i].x && P_bullets[i].y == enemies[i].y) { + P_bullets[i].is_live = false; + enemies[i].hp--; + } + } + break; + } + } + else if (dir == DOWN) { //1 + enemies[i].dir = DOWN; + switch (TankMoveCheck(dir, enemies[i])) { //յ,з̹,ӵ,ǽ + case BLANK: + enemies[i].y++; + break; + case BULLET: + enemies[i].y++; + for (int i = 0; i < BULLET_NUM; i++) { //ӵ + if (P_bullets[i].x == enemies[i].x && P_bullets[i].y == enemies[i].y) { + P_bullets[i].is_live = false; + enemies[i].hp--; + } + } + break; + } + } + else if (dir == LEFT) { //2 + enemies[i].dir = LEFT; + switch (TankMoveCheck(dir, enemies[i])) { //յ,з̹,ӵǽ + case BLANK: + enemies[i].x--; + break; + case BULLET: + enemies[i].x--; + for (int i = 0; i < BULLET_NUM; i++) { //ӵ + if (P_bullets[i].x == enemies[i].x && P_bullets[i].y == enemies[i].y) { + P_bullets[i].is_live = false; + enemies[i].hp--; + } + } + break; + } + } + else if (dir == RIGHT) { //3 + enemies[i].dir = RIGHT; + switch (TankMoveCheck(dir, enemies[i])) { //յ,з̹,ӵ,ǽ + case BLANK: + enemies[i].x++; + break; + case BULLET: + enemies[i].x++; + for (int i = 0; i < BULLET_NUM; i++) { //ӵ + if (P_bullets[i].x == enemies[i].x && P_bullets[i].y == enemies[i].y) { + P_bullets[i].is_live = false; + enemies[i].hp--; + } + } + break; + } + } + } +} + +/* + ˣ + ܣ + շBulletMoveCheck() +ķֵжӵƶ + ʵӵƶ +*/ + +void PlayerBulletMove() { + static clock_t start = clock() - 100; + if ((clock() - start) < 100) + return; + start = clock(); + + int arr[4][2] = { + {0, -1}, + {0, 1}, + {-1, 0}, + {1, 0}, + }; + for (int i = 0; i < BULLET_NUM; i++) // ӵ + { + if (P_bullets[i].is_live == false) + { + continue; + } + else + { + // ӵײ⣺Ƿյءǽ̹ˡз̹ˡз̹ˡӵзӵ + // 0->յء1->ʾǽ2->̹ˡ3->̹ˡ4->̹ˡ5->ҷӵ6->зӵ + // 0 յ 1 ǽ 3 з̹ 6 зӵ + int type = BulletMoveCheck(P_bullets[i].dir, P_bullets[i]); + if (type == BLANK) + { + P_bullets[i].x += arr[P_bullets[i].dir][0]; + P_bullets[i].y += arr[P_bullets[i].dir][1]; + } + else if (type == WALL) + { + P_bullets[i].is_live = false; + } + else if (type == BLUE_TANK) //з̹ + { + P_bullets[i].is_live = false; //ӵ + for (int k = 0; k < ENEMIES_NUM; k++) //̹˱ + { + switch (P_bullets[i].dir) { + case UP: + if (enemies[k].x == P_bullets[i].x && enemies[k].y == P_bullets[i].y - 1) //Ϸз̹ + { + enemies[k].hp -= P_bullets[i].damage; + } + break; + case DOWN: + if (enemies[k].x == P_bullets[i].x && enemies[k].y == P_bullets[i].y + 1) //Ϸз̹ + { + enemies[k].hp -= P_bullets[i].damage; + } + break; + case LEFT: + if (enemies[k].x == P_bullets[i].x - 1 && enemies[k].y == P_bullets[i].y) //Ϸз̹ + { + enemies[k].hp -= P_bullets[i].damage; + } + break; + case RIGHT: + if (enemies[k].x == P_bullets[i].x + 1 && enemies[k].y == P_bullets[i].y) //Ϸз̹ + { + enemies[k].hp -= P_bullets[i].damage; + } + break; + default: // ĬϷ֧ + break; + } + + } + } + else + { + P_bullets[i].is_live = false; + if (BULLET_NUM == 2) + { + for (int k = 3; k <= 8; k++) + { + if (P_bullets[k].x == P_bullets[i].x && P_bullets[k].y == P_bullets[i].y) + { + P_bullets[k].is_live = false; + break; + } + } + } + else + { + for (int k = 3; k <= 12; k++) + { + if (P_bullets[k].x == P_bullets[i].x && P_bullets[k].y == P_bullets[i].y) + { + P_bullets[k].is_live = false; + break; + } + } + } + break; + } + } + } +} + +void EnemyBulletMove() { + static clock_t start = clock() - 500; + if ((clock() - start) < 500) + return; + start = clock(); + + int arr[4][2] = { + {0, -1}, + {0, 1}, + {-1, 0}, + {1, 0}, + }; + for (auto& i : E_bullets) { + if (i.is_live) { + int type = BulletMoveCheck(i.dir, i); + if (type == BLANK) + { + i.x += arr[i.dir][0]; + i.y += arr[i.dir][1]; + } + else if (type == WALL) + { + i.is_live = false; + } + else if (type == RED_TANK) + { + i.is_live = false; + player.hp -= i.damage; + } + else { + i.x += arr[i.dir][0]; + i.y += arr[i.dir][1]; + } + /*else + { + i.is_live = false; + if (BULLET_NUM == 2) + { + for (int k = 3; k <= 8; k++) + { + if (P_bullets[k].x == i.x && P_bullets[k].y == i.y) + { + P_bullets[k].is_live = false; + break; + } + } + } + else + { + for (int k = 3; k <= 12; k++) + { + if (P_bullets[k].x == i.x && P_bullets[k].y == i.y) + { + P_bullets[k].is_live = false; + break; + } + } + } + break; + }*/ + } + } +} +/* + ˣ + ܣ̹ +*/ +void PlayerInit() +{ + player.x = MAP_CELL_NUM / 2; // ʼ + player.y = MAP_CELL_NUM / 2; + player.hp = 5; // Ѫʼ + player.dir = UP; // ʼҷ + player.attack = 5; // ʼҹΪ 5 + kill = 0; // ҳʼɱΪ 0 + map[player.x][player.y] = RED_TANK; // ڵͼϱ̹˵λ +} + +/* + ˣ + ܣɵз̹ +*/ +void EnemyInit() +{ + srand((unsigned int)time(NULL)); // + // ʹ ⴴ + //default_random_engine generator; + //uniform_int_distribution distribution(0, 49); // һȷֲɵΧ1-48 + + // ʼ̹ + for (int i = 0; i < ENEMIES_NUM; i++) { + enemies[i].x = rand() % (MAP_CELL_NUM - 2) + 1 ; // ʹ + enemies[i].y = rand() % (MAP_CELL_NUM - 2) + 1; + + // ɵλѾ̹˻ǽô + while (map[enemies[i].x][enemies[i].y] != BLANK) { + enemies[i].x = rand() % (MAP_CELL_NUM - 2) + 1; + enemies[i].y = rand() % (MAP_CELL_NUM - 2) + 1; + } + + enemies[i].hp = enemy.hp; // ˳ʼѪΪ5 + enemies[i].attack = enemy.attack; // ˳ʼΪ1 + enemies[i].dir = LEFT; // ˳ʼ泯 + map[enemies[i].x][enemies[i].y] = BLUE_TANK; // ڵͼϱǵλ + } +} + +/* + ˣ + ܣ + ֵΪ:˵ʧܣ̹hp<=0߻û棺̹hp>0,з̹>0 + ֵΪ棺˵Ӯ ̹hp==0,з̹==0 +*/ +bool IsWin() { + bool all_die = true; + for (auto& i : enemies) { + if (i.hp > 0) + all_die = false; + } + if (player.hp > 0 && all_die) { + return true; // ʤ + } + else return false; // ûʤʧܡ ϷС +} + +// +void Level() +{ + cleardevice(); + IMAGE img_memberview; + loadimage(&img_memberview, ".//images//Ϸ汳.jpg", 700, 700); + putimage(0, 0, &img_memberview); + + IMAGE img_easy; + loadimage(&img_easy, ".//images//Ѷ.jpg", 150, 100); + putimage(275, 150, &img_easy); + + IMAGE img_middle; + loadimage(&img_middle, ".//images//еѶ.jpg", 150, 100); + putimage(275, 300, &img_middle); + + IMAGE img_difficult; + loadimage(&img_difficult, ".//images//Ѷ.jpg", 150, 100); + putimage(275, 450, &img_difficult); + + //̲ + ExMessage msg; + while (true) + { + //̲ + if (_kbhit()) + { + char key = _getch();//һֱ + //printf("%d,%c\n", key, key); + switch (key) + { + case 27://ϼ + //ز˵ + MenuView(); + //printf("ز˵/n"); + return; + break; + } + } + + // + if (peekmessage(&msg, WH_MOUSE)) + { + switch (msg.message) + { + case WM_LBUTTONDOWN: + + //ѡѶ + if (msg.x >= 275 && msg.x <= 425 && msg.y >= 150 && msg.y <= 250) + { + enemy.hp = 5; + enemy.attack = 1; + //printf("Ѷ\n"); + MenuView(); + //printf("ز˵/n"); + return; + } + //ѡеѶ + if (msg.x >= 275 && msg.x <= 425 && msg.y >= 300 && msg.y <= 400) + { + enemy.hp = 10; + enemy.attack = 2; + //printf("еѶ\n"); + MenuView(); + //printf("ز˵/n"); + return; + } + //ѡѶ + if (msg.x >= 275 && msg.x <= 425 && msg.y >= 450 && msg.y <= 550) + { + enemy.hp = 15; + enemy.attack = 3; + //printf("Ѷ\n"); + MenuView(); + //printf("ز˵/n"); + return; + } + break; + default: + break; + } + } + } +} + +// +void MemberView() +{ + cleardevice(); + IMAGE img_memberview; + loadimage(&img_memberview, ".//images//Ա.jpg", 700, 700); + putimage(0, 0, &img_memberview); + + IMAGE img_back; + loadimage(&img_back, ".//images//ذť.jpg", 150, 50); + putimage(30, 550, &img_back); + // + ExMessage msg; + while (true) + { + //̲ + if (_kbhit()) + { + char key = _getch();//һֱ + //printf("%d,%c\n", key, key); + switch (key) + { + case 27://ϼ + //ز˵ + MenuView(); + //printf("ز˵/n"); + return; + break; + } + } + + // + if (peekmessage(&msg, WH_MOUSE)) + { + switch (msg.message) + { + case WM_LBUTTONDOWN: + + //ص˵ + if (msg.x >= 30 && msg.x <= 180 && msg.y >= 550 && msg.y <= 600) + { + MenuView(); + return; + //printf("ص˵\n"); + //תѶȽ + } + break; + default: + break; + } + } + } +} + +// +void MenuView() +{ + InitMap(); + cleardevice(); + //ͼƬ + setbkmode(TRANSPARENT); + IMAGE img_menuview; + loadimage(&img_menuview, ".//images//˵.jpg", 700, 700); + putimage(0, 0, &img_menuview); + + IMAGE img_start; + loadimage(&img_start, ".//images//ʼϷ.jpg", 150, 50); + putimage(50, 250, &img_start); + + IMAGE img_level; + loadimage(&img_level, ".//images//Ѷð.jpg", 150, 50); + putimage(50, 330, &img_level); + + IMAGE img_member; + loadimage(&img_member, ".//images//Ա.jpg", 150, 50); + putimage(50, 410, &img_member); + + IMAGE img_quit; + loadimage(&img_quit, ".//images//˳Ϸ.jpg", 150, 50); + putimage(50, 490, &img_quit); + // + ExMessage msg; + while (true) + { + + // + if (peekmessage(&msg, WH_MOUSE)) + { + switch (msg.message) + { + case WM_LBUTTONDOWN: + + //תϷ + if (msg.x >= 50 && msg.x <= 200 && msg.y >= 250 && msg.y <= 300) + { + GameView(); + //printf("ʼϷ\n"); + } + //תѶȽ + if (msg.x >= 50 && msg.x <= 200 && msg.y >= 330 && msg.y <= 380) + { + Level(); + return; + //printf("Ѷ\n"); + } + //תԱ + if (msg.x >= 50 && msg.x <= 200 && msg.y >= 410 && msg.y <= 460) + { + MemberView(); + return; + //printf("Ա\n"); + } + //Ϸ + if (msg.x >= 50 && msg.x <= 200 && msg.y >= 490 && msg.y <= 540) + { + exit(0); + } + break; + default: + break; + } + } + } +} + +void change() +{ + //ȡھ + HWND hnd = GetHWnd(); + //ôڱ + SetWindowText(hnd, "ֽ̹"); +} + + +//-------------------service--------------- + +/* + ˣɥɥ +*/ +int main() { + // bgm + //PlaySound(LPWSTR(IDR_WAVE1), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC | SND_LOOP); + PlaySound(MAKEINTRESOURCE(IDR_WAVE1), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC | SND_LOOP); + + // ---------------------- + // + initgraph(700, 700); + change(); + + MenuView(); + + getchar(); + //رմ + closegraph(); + + return 0; +} \ No newline at end of file diff --git a/tank_battles_on_the_scrap_paper/map.cpp b/tank_battles_on_the_scrap_paper/map.cpp new file mode 100644 index 0000000..bc78e00 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/map.cpp @@ -0,0 +1,54 @@ +// map.cpp +#include "map.h" + +// ͼ +int map1[50][50]; +int map2[50][50]; + +void init_map1() +{ + for (int i = 0; i < 50; i++) + { + for (int j = 0; j < 50; j++) + { + // Ϊǽ + if (i == 0 || i == 49 || j == 0 || j == 49) + { + map1[i][j] = WALL; + } + // м+״ + else if (i == 24 || j == 24) + { + map1[i][j] = WALL; + } + else + { + map1[i][j] = BLANK; + } + } + } +} + +void init_map2() +{ + for (int i = 0; i < 50; i++) + { + for (int j = 0; j < 50; j++) + { + // Ϊǽ + if (i == 0 || i == 49 || j == 0 || j == 49) + { + map2[i][j] = WALL; + } + // мX״ + else if (i == j || i + j == 49) + { + map2[i][j] = WALL; + } + else + { + map2[i][j] = BLANK; + } + } + } +} diff --git a/tank_battles_on_the_scrap_paper/map.h b/tank_battles_on_the_scrap_paper/map.h new file mode 100644 index 0000000..580b357 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/map.h @@ -0,0 +1,16 @@ +// ԤƵͼ +// map.h +#ifndef MAP_H +#define MAP_H + +#include "data_config.h" + +// ͼ +extern int map1[50][50]; +extern int map2[50][50]; + +// ͼʼ +void init_map1(); +void init_map2(); + +#endif // !MAP_H diff --git a/tank_battles_on_the_scrap_paper/music/bgm.wav b/tank_battles_on_the_scrap_paper/music/bgm.wav new file mode 100644 index 0000000..2f32f28 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/music/bgm.wav differ diff --git a/tank_battles_on_the_scrap_paper/resource.h b/tank_battles_on_the_scrap_paper/resource.h new file mode 100644 index 0000000..6964a71 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ ɵİļ +// resource.rc ʹ +// +#define IDR_WAVE1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/tank_battles_on_the_scrap_paper/resource.rc b/tank_battles_on_the_scrap_paper/resource.rc new file mode 100644 index 0000000..ada8777 Binary files /dev/null and b/tank_battles_on_the_scrap_paper/resource.rc differ diff --git a/tank_battles_on_the_scrap_paper/tank.h b/tank_battles_on_the_scrap_paper/tank.h new file mode 100644 index 0000000..9b020d1 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/tank.h @@ -0,0 +1,33 @@ +// ̹˶ +#ifndef TANK_H +#define TANK_H + +/* + ̹ˣ + ꣺xy + Ѫhpʾǰ̹Ѫ + attackʾǰ̹˹ + dir + UP + DOWN + LEFT + RIGHT +*/ +enum Direction { + UP, // + DOWN, // + LEFT, // + RIGHT, // +}; + +struct tank { + int x, y;// + int hp; // Ѫ + int attack; // + int dir; // + bool is_taken = false;//̹ǷѾҼȡ + + tank(): attack(1), hp(5){} +}; + +#endif // !TANK_H diff --git a/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj b/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj new file mode 100644 index 0000000..4157d31 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {ac8c4a04-1650-473c-8e9a-3b7cde2ad5cc} + tankbattlesonthescrappaper + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + MultiByte + + + Application + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj.filters b/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj.filters new file mode 100644 index 0000000..97a5b30 --- /dev/null +++ b/tank_battles_on_the_scrap_paper/tank_battles_on_the_scrap_paper.vcxproj.filters @@ -0,0 +1,46 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 资源文件 + + + + + 资源文件 + + + \ No newline at end of file