新增GameMap和GameTown类实现游戏地图和城镇的核心功能 添加GameWorld作为游戏世界管理器处理场景切换 完善音频系统支持从路径加载音乐和音效 重构PVF资源系统增加路径规范化功能 添加.gitignore排除游戏资源目录
33 lines
639 B
C++
33 lines
639 B
C++
#pragma once
|
|
|
|
#include "GameTown.h"
|
|
#include <frostbite2D/scene/scene.h>
|
|
#include <map>
|
|
|
|
namespace frostbite2D {
|
|
|
|
class GameWorld : public Scene {
|
|
public:
|
|
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
|