#include #include #include "Runner.hpp" #include #include "Component/Music/MusicComponent.hpp" #include "Component/Sound/SoundComponent.hpp" #include "Component/Controllable/ControllableComponent.hpp" #include "Component/Position/PositionComponent.hpp" #include "Component/Animator/AnimatorComponent.hpp" #include "Component/Animation/AnimationsComponent.hpp" #include "Component/Health/HealthComponent.hpp" #include "Component/Renderer/CameraComponent.hpp" #include "Component/Collision/CollisionComponent.hpp" #include "Component/Movable/MovableComponent.hpp" #include "Component/BombHolder/BombHolderComponent.hpp" #include "Component/Shaders/ShaderComponent.hpp" #include "Component/Tag/TagComponent.hpp" #include "Component/Renderer/Drawable3DComponent.hpp" #include "Model/Model.hpp" #include "Map/Map.hpp" namespace RAY3D = RAY::Drawables::Drawables3D; namespace BBM { std::shared_ptr Runner::loadGameScene() { auto scene = std::make_shared(); scene->addEntity("camera") .addComponent(8, 20, 7) .addComponent(Vector3f(8, 0, 8)); MapGenerator::loadMap(16, 16, MapGenerator::createMap(16, 16), scene); return scene; } WAL::Entity &Runner::createPlayer(WAL::Scene &scene) { std::map soundPath ={ {SoundComponent::JUMP, "assets/sounds/jump.wav"}, {SoundComponent::MOVE, "assets/sounds/move.ogg"}, {SoundComponent::BOMB, "assets/sounds/bomb_drop.ogg"}, //{SoundComponent::DEATH, "assets/sounds/death.ogg"} }; return scene.addEntity("player") .addComponent() .addComponent("assets/player/player.iqm", true) .addComponent() .addComponent() // .addComponent("assets/shaders/glsl330/predator.fs") .addComponent>() .addComponent("assets/player/player.iqm", 3) .addComponent(BBM::Vector3f{0.25, 0, 0.25}, BBM::Vector3f{.75, 2, .75}) .addComponent() .addComponent(soundPath) .addComponent("assets/musics/music_battle.ogg") .addComponent() .addComponent(1, [](WAL::Entity &entity, WAL::Wal &) { auto &animation = entity.getComponent(); animation.setAnimIndex(5); }); } }