This commit is contained in:
2026-02-08 17:05:17 +08:00
parent 8b88904ef7
commit 0b31c30b38
5 changed files with 46 additions and 42 deletions

View File

@@ -385,6 +385,7 @@ void GameMap::Enter()
void GameMap::OnUpdate(float deltaTime)
{
Actor::OnUpdate(deltaTime);
RefPtr<GameCamera> Cam = Global_Game::GetInstance().GetCamera();
if (Cam == nullptr)
@@ -431,7 +432,6 @@ void GameMap::OnUpdate(float deltaTime)
Layer.second->SetPosition(posX, posY);
}
Actor::OnUpdate(deltaTime);
}

View File

@@ -25,26 +25,26 @@ void GameWorld::Exit()
void GameWorld::Init()
{
// RefPtr<Animation> ani = new Animation("common/tuguan/maineff.ani");
RefPtr<Sprite> sp = new Sprite("sprite/live/else/chn/2022/0510_danjin_jar/22_danjineft/0510_danjin_body.img",0);
RefPtr<AnimationMap> am = new AnimationMap();
// am->AddAnimation(ani);
am->AddChild(sp);
am->CompleteConstruction();
AddChild(am);
// RefPtr<Sprite> sp = new Sprite("sprite/live/else/chn/2022/0510_danjin_jar/22_danjineft/0510_danjin_body.img",0);
// RefPtr<AnimationMap> am = new AnimationMap();
// // am->AddAnimation(ani);
// am->AddChild(sp);
// am->CompleteConstruction();
// AddChild(am);
// // 构造所有城镇
// auto &GlobalGame = Global_Game::GetInstance();
// for (auto obj : GlobalGame.GetTownMap())
// {
// RefPtr<GameTown> town = new GameTown;
// town->Init(obj.first);
// m_TownMap[obj.first] = town;
// }
// 构造所有城镇
auto &GlobalGame = Global_Game::GetInstance();
for (auto obj : GlobalGame.GetTownMap())
{
RefPtr<GameTown> town = new GameTown;
town->Init(obj.first);
m_TownMap[obj.first] = town;
}
// // 构造角色
// RefPtr<CharacterObject> obj = new CharacterObject();
// obj->Construction(0);
// AddCharacter(obj, 1);
// 构造角色
RefPtr<CharacterObject> obj = new CharacterObject();
obj->Construction(0);
AddCharacter(obj, 1);
}
void GameWorld::AddCharacter(RefPtr<CharacterObject> Chr, int TownId)

View File

@@ -40,7 +40,7 @@ void CharacterObject::DisableController()
void CharacterObject::ControllerMsg(CONTROLLER_MSG_TYPE msgType, void *msgData)
{
// 摇杆移动(左)
// 摇杆移动
if (msgType == CONTROLLER_MSG_TYPE::CONTROLLER_MSG_TYPE_LEFT_JOYSTICK_MOVE)
{
Vec2 *pos = (Vec2 *)msgData;