mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-25 23:49:03 +00:00
Fixing movements
This commit is contained in:
@@ -5,12 +5,11 @@
|
||||
#include "Component/Position/PositionComponent.hpp"
|
||||
#include "MovableSystem.hpp"
|
||||
#include "Component/Movable/MovableComponent.hpp"
|
||||
#include "Wal.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
MovableSystem::MovableSystem()
|
||||
: System({
|
||||
: WAL::System({
|
||||
typeid(MovableComponent),
|
||||
typeid(PositionComponent)
|
||||
})
|
||||
@@ -21,8 +20,8 @@ namespace BBM
|
||||
auto &movable = entity.getComponent<MovableComponent>();
|
||||
auto &position = entity.getComponent<PositionComponent>();
|
||||
|
||||
position.position += movable._velocity * WAL::Wal::timestep.count();
|
||||
movable._velocity = movable._acceleration * WAL::Wal::timestep.count();
|
||||
position.position += movable._velocity;
|
||||
movable._velocity = movable._acceleration;
|
||||
movable._acceleration = Vector3f();
|
||||
}
|
||||
}
|
||||
} // namespace WAL
|
||||
Reference in New Issue
Block a user