Files
Bomberman/sources/System/Controllable/ControllableSystem.cpp
TrueBabyChaise 54cb40aa0b Modification on Controllable and Keyboard
Add float variable instead of bool for the axes movement, and use of a map for classic keys

Co-Authored-By: Benjamin HENRY <44569175+EternalRat@users.noreply.github.com>
2021-05-21 14:17:37 +02:00

25 lines
713 B
C++

//
// Created by Tom Augier on 2021-05-20.
// Edited by Benjamin Henry on 2021-05-20.
//
#include "ControllableSystem.hpp"
#include "lib/wal/sources/Component/Movable/MovableComponent.hpp"
#include "sources/Component/Controllable/ControllableComponent.hpp"
#include "lib/wal/sources/Entity/Entity.hpp"
namespace BBM
{
const std::type_info &ControllableSystem::getComponent() const
{
return typeid(ControllableComponent);
}
void ControllableSystem::onFixedUpdate(WAL::Entity &entity)
{
auto &controllable = entity.getComponent<ControllableComponent>();
auto &movable = entity.getComponent<WAL::MovableComponent>();
movable.addForce(WAL::Vector3f(controllable._moveX, 0, controllable._moveZ));
}
}