2022-02-18 16:33:24 +08:00
|
|
|
|
# SpaceWar
|
2022-02-03 22:37:41 +08:00
|
|
|
|
|
2022-02-19 17:49:30 +08:00
|
|
|
|
一款空战类游戏。采用C++17开发。
|
|
|
|
|
|
|
|
|
|
## 1MGames相关
|
|
|
|
|
|
|
|
|
|
1MGames比赛相关代码在`1mgames`分支下。此分支在未来可能会继续开发,目前不稳定。
|
2022-02-03 22:37:41 +08:00
|
|
|
|
|
2022-02-04 14:07:03 +08:00
|
|
|
|
## 编译方法
|
|
|
|
|
|
2022-02-19 17:49:30 +08:00
|
|
|
|
依赖:
|
2022-02-18 16:33:24 +08:00
|
|
|
|
|
2022-02-19 17:49:30 +08:00
|
|
|
|
* SDL, SDL\_image, SDL\_ttf
|
|
|
|
|
|
|
|
|
|
使用CMake 3.20及以上进行编译。需要拉取`SDLEngine`作为子工程:
|
2022-02-18 22:07:48 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后编译:
|
2022-02-04 14:07:03 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
|
|
|
|
|
cmake --build build
|
|
|
|
|
```
|
|
|
|
|
|
2022-02-18 16:33:24 +08:00
|
|
|
|
编译好后执行pack命令打包
|
2022-02-04 14:07:03 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2022-02-18 16:54:44 +08:00
|
|
|
|
cmake --build build --target Pack
|
2022-02-04 14:07:03 +08:00
|
|
|
|
```
|
|
|
|
|
|
2022-02-18 16:33:24 +08:00
|
|
|
|
最终的结果在`output`文件夹下:
|
|
|
|
|
|
|
|
|
|
* game:包含了游戏本体
|
|
|
|
|
* snapshot:包含了游戏的截图
|
|
|
|
|
* HowToPlay.md:游戏说明
|
2022-02-17 15:12:24 +08:00
|
|
|
|
|
|
|
|
|
## 游戏截图
|
|
|
|
|
|
|
|
|
|
![welcome](./snapshot/welcome.png)
|
|
|
|
|
|
|
|
|
|
![select](./snapshot/select_ship.png)
|
|
|
|
|
|
|
|
|
|
![gaming](./snapshot/gaming.png)
|
|
|
|
|
|
2022-02-18 16:33:24 +08:00
|
|
|
|
![gaming2](./snapshot/gaming2.png)
|
|
|
|
|
|
2022-02-17 15:12:24 +08:00
|
|
|
|
## 游戏操作
|
|
|
|
|
|
|
|
|
|
[游戏操作](./HowToPlay.md)
|