Add Switch game framework target
This commit is contained in:
@@ -21,6 +21,7 @@ game/
|
||||
├─ movement/ 可复用的移动和碰撞辅助工具
|
||||
├─ scene/ 游戏场景和关卡编排
|
||||
├─ stage/ 关卡视觉层渲染
|
||||
├─ switch_game_main.cpp Switch/NS 游戏入口
|
||||
└─ main.cpp 游戏可执行文件入口点
|
||||
```
|
||||
|
||||
@@ -99,8 +100,8 @@ main.cpp
|
||||
|
||||
## 当前构建目标
|
||||
|
||||
`xmake.lua` 为 Windows 定义 `Frostbite2DGame`。它编译所有
|
||||
`game/src/**.cpp` 文件,链接到 `Frostbite2D`,并在构建后
|
||||
`xmake.lua` 为 Windows 定义 `Frostbite2DGame`。它编译桌面游戏入口
|
||||
`game/src/main.cpp` 和所有通用游戏源码,链接到 `Frostbite2D`,并在构建后
|
||||
将 `game/assets` 复制到可执行文件旁边。
|
||||
|
||||
构建命令:
|
||||
@@ -115,6 +116,29 @@ xmake -b Frostbite2DGame
|
||||
build/windows/x64/release/Frostbite2DGame.exe
|
||||
```
|
||||
|
||||
Switch/NS 游戏框架目标为 `Frostbite2DGameSwitch`。它使用
|
||||
`game/src/switch_game_main.cpp` 作为平台入口,复用同一套 Scene、Stage、
|
||||
Actor、Movement、Debug 和 Data 模块。
|
||||
|
||||
构建命令:
|
||||
|
||||
```powershell
|
||||
xmake -b Frostbite2DGameSwitch
|
||||
```
|
||||
|
||||
输出:
|
||||
|
||||
```text
|
||||
build/switch/aarch64/release/Frostbite2DGame.elf
|
||||
build/switch/aarch64/release/switch_game/NSUnknownGame.nro
|
||||
```
|
||||
|
||||
Switch 运行时资源目录:
|
||||
|
||||
```text
|
||||
/switch/Frostbite2D/NS Unknown Game/assets
|
||||
```
|
||||
|
||||
## 后续架构步骤
|
||||
|
||||
1. 添加 `actor/enemy_actor.*` 并复用 `PlatformMover`
|
||||
|
||||
Reference in New Issue
Block a user