mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-27 00:06:49 +00:00
Merge branch 'fixes' of github.com:AnonymusRaccoon/Bomberman into ai_script
This commit is contained in:
@@ -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>();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -92,6 +92,5 @@ namespace BBM
|
||||
newCameraPos.y = maxDist;
|
||||
newCameraPos.z -= newCameraPos.z > 1 ? 1 : 0;
|
||||
pos.position += (newCameraPos.abs() - pos.position.abs()) / 10;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user