Merge branch 'fixes' of github.com:AnonymusRaccoon/Bomberman into ai_script

This commit is contained in:
Bluub
2021-06-19 16:01:52 +02:00
4 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -122,7 +122,9 @@ namespace BBM
return;
entity.getComponent<ControllableComponent>().disabled = true;
entity.addComponent<TimerComponent>(1s, [](WAL::Entity &ent, WAL::Wal &) {
ent.scheduleDeletion();
ent.removeComponent<SoundComponent>();
ent.removeComponent<CollisionComponent>();
ent.removeComponent<PositionComponent>();
});
});
}
+3 -1
View File
@@ -17,7 +17,7 @@ namespace BBM
: System(wal)
{}
void GamepadSystem::onFixedUpdate(WAL::ViewEntity<GamepadComponent, ControllableComponent> &entity)
void GamepadSystem::onUpdate(WAL::ViewEntity<GamepadComponent, ControllableComponent> &entity, std::chrono::nanoseconds)
{
const auto &gamepadComponent = entity.get<GamepadComponent>();
auto &controllable = entity.get<ControllableComponent>();
@@ -34,6 +34,8 @@ namespace BBM
for (auto key : keyPressedMap)
key.second = controllable.fastClick ? gamepad.isDown(key.first) : gamepad.isPressed(key.first);
if (gamepad.isPressed(GAMEPAD_BUTTON_MIDDLE_LEFT) || gamepad.isPressed(GAMEPAD_BUTTON_MIDDLE_RIGHT))
controllable.pause = true;
controllable.move.x = gamepad.getAxisValue(gamepadComponent.LeftStickX) * -1;
controllable.move.y = gamepad.getAxisValue(gamepadComponent.LeftStickY) * -1;
controllable.move.x -= static_cast<float>(gamepad.isDown(gamepadComponent.keyRight));
+1 -1
View File
@@ -16,7 +16,7 @@ namespace BBM
{
public:
//! @inherit
void onFixedUpdate(WAL::ViewEntity<GamepadComponent, ControllableComponent> &entity) override;
void onUpdate(WAL::ViewEntity<GamepadComponent, ControllableComponent> &entity, std::chrono::nanoseconds) override;
//! @brief A default constructor
explicit GamepadSystem(WAL::Wal &wal);
-1
View File
@@ -92,6 +92,5 @@ namespace BBM
newCameraPos.y = maxDist;
newCameraPos.z -= newCameraPos.z > 1 ? 1 : 0;
pos.position += (newCameraPos.abs() - pos.position.abs()) / 10;
}
}