mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-01 01:38:14 +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
|
||||
@@ -6,6 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "System/System.hpp"
|
||||
#include "Entity/Entity.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
@@ -25,4 +26,4 @@ namespace BBM
|
||||
//! @brief A movable system is assignable.
|
||||
MovableSystem &operator=(const MovableSystem &) = default;
|
||||
};
|
||||
}
|
||||
} // namespace WAL
|
||||
|
||||
Reference in New Issue
Block a user