void TestZone::OnLoad(mono::ICameraPtr camera) { File::FilePtr world_file = File::OpenBinaryFile("world.world"); world::LevelFileHeader world_header; world::ReadWorld(world_file, world_header); game::LoadWorld(this, world_header.polygons); AddUpdatable(std::make_shared<ListenerPositionUpdater>(camera)); AddUpdatable(std::make_shared<HealthbarUpdater>(m_healthbars, m_damageController, *this)); AddDrawable(std::make_shared<HealthbarDrawer>(m_healthbars), FOREGROUND); std::shared_ptr<Shuttle> shuttle = std::make_shared<Shuttle>(math::zeroVec, mEventHandler); AddPhysicsEntity(shuttle, FOREGROUND); AddPhysicsEntity(game::CreateCacoDemon(math::Vector(100, 100), mEventHandler), FOREGROUND); AddPhysicsEntity(game::CreateInvader(math::Vector(200.0f, 1000.0f), mEventHandler), MIDDLEGROUND); AddPhysicsEntity(game::CreateInvader(math::Vector(200.0f, 1000.0f), mEventHandler), MIDDLEGROUND); AddPhysicsEntity(game::CreateInvader(math::Vector(200.0f, 1000.0f), mEventHandler), MIDDLEGROUND); AddPhysicsEntity(game::CreateInvader(math::Vector(200.0f, 1000.0f), mEventHandler), MIDDLEGROUND); AddPhysicsEntity(game::CreateInvader(math::Vector(200.0f, 1000.0f), mEventHandler), MIDDLEGROUND); AddEntity(std::make_shared<InvaderGroup>(math::Vector(300.0f, 800.0f)), BACKGROUND); AddEntity(std::make_shared<DotEntity>(), FOREGROUND); AddEntity(std::make_shared<PathPoint>(), BACKGROUND); AddEntity(std::make_shared<game::CubeSwarm>(), FOREGROUND); AddMeteorCluster(this); camera->SetPosition(shuttle->Position()); camera->Follow(shuttle, math::Vector(0, -100)); m_backgroundMusic->Play(); }
void Animator::OnLoad(mono::ICameraPtr camera) { m_camera = camera; camera->SetPosition(math::zeroVec); }