Changed the entity system to utilize mix-ins. Added instanced sprites. Texture support.
18 lines
460 B
C++
18 lines
460 B
C++
#include <Game/entity/Box.h>
|
|
#include <Engine/Globals.h>
|
|
#include <JGL/JGL.h>
|
|
|
|
void Game::Box::Render() {
|
|
J2D::FillRect(Colors::Red, Vector2(position), {20, 20});
|
|
}
|
|
|
|
void Game::Box::Update() {
|
|
if (Globals::Window->IsKeyDown(Keys::W))
|
|
MoveY(-500);
|
|
if (Globals::Window->IsKeyDown(Keys::S))
|
|
MoveY(500);
|
|
if (Globals::Window->IsKeyDown(Keys::A))
|
|
MoveX(-500);
|
|
if (Globals::Window->IsKeyDown(Keys::D))
|
|
MoveX(500);
|
|
} |