16 lines
570 B
C++
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());
|
|
} |