Files
DemoGame/src/Game/Entities/Box.cpp
Redacted a86ac432fb Smoother movement
Interpolation & Extrapolation still todo.
2025-01-15 02:11:27 -05:00

16 lines
570 B
C++

#include <Game/entity/Box.h>
#include <Engine/Globals.h>
void Game::Box::Update() {
if (Globals::Window->IsKeyDown(Keys::W))
AddVelocity(WorldUp(), 100);
if (Globals::Window->IsKeyDown(Keys::S))
AddVelocity(WorldDown(), 100);
if (Globals::Window->IsKeyDown(Keys::A))
AddVelocity(WorldLeft(), 100);
if (Globals::Window->IsKeyDown(Keys::D))
AddVelocity(WorldRight(), 100);
if (Globals::Window->IsKeyDown(Keys::Space))
AddVelocity(HeadingRelativeBackward(), GetVelocity());
Move(GetScene()->GetTickRate());
}