feat: 实现游戏地图和城镇系统基础架构

新增GameMap和GameTown类实现游戏地图和城镇的核心功能
添加GameWorld作为游戏世界管理器处理场景切换
完善音频系统支持从路径加载音乐和音效
重构PVF资源系统增加路径规范化功能
添加.gitignore排除游戏资源目录
This commit is contained in:
2026-04-01 09:53:06 +08:00
parent 42e5579cc3
commit d55808d80f
20 changed files with 1288 additions and 25 deletions

View File

@@ -1,18 +1,32 @@
#pragma once
#include "GameTown.h"
#include <frostbite2D/scene/scene.h>
#include <map>
#include "GameTown.h"
namespace frostbite2D {
class GameWorld : public Scene {
private:
/**城镇Map */
std::map<int, RefPtr<GameTown>> m_TownMap;
public:
GameWorld();
~GameWorld();
~GameWorld() override = default;
void onEnter() override;
void onExit() override;
void AddCharacter(RefPtr<Actor> actor, int townId);
void MoveCharacter(RefPtr<Actor> actor, int townId, int area);
static GameWorld* GetWorld();
private:
bool InitWorld();
std::map<int, std::string> townPathMap_;
std::map<int, RefPtr<GameTown>> townMap_;
RefPtr<Actor> mainActor_;
int curTown_ = -1;
bool initialized_ = false;
};
} // namespace frostbite2D