Add acceleration to movement code
This commit is contained in:
@@ -17,7 +17,10 @@ public:
|
||||
Entity(const glm::vec2 pos, const std::string texName);
|
||||
~Entity();
|
||||
|
||||
glm::vec2 pos;
|
||||
|
||||
glm::vec2 pos; // Position
|
||||
glm::vec2 dPos; // Velocity
|
||||
|
||||
glm::vec2 size;
|
||||
const Texture *tex;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef DENGINE_MATH_H
|
||||
#define DENGINE_MATH_H
|
||||
|
||||
#include <Dengine/Common.h>
|
||||
|
||||
namespace Dengine
|
||||
{
|
||||
class Math
|
||||
{
|
||||
public:
|
||||
static inline f32 squared(const f32 a)
|
||||
{
|
||||
f32 result = a * a;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#ifndef WORLDTRAVELLER_GAME_H
|
||||
#define WORLDTRAVELLER_GAME_H
|
||||
|
||||
#include <Dengine/OpenGL.h>
|
||||
#include <Dengine/AssetManager.h>
|
||||
#include <Dengine/Common.h>
|
||||
#include <Dengine/Entity.h>
|
||||
#include <Dengine/Math.h>
|
||||
#include <Dengine/OpenGL.h>
|
||||
#include <Dengine/Renderer.h>
|
||||
#include <Dengine/Shader.h>
|
||||
#include <Dengine/AssetManager.h>
|
||||
#include <Dengine/Entity.h>
|
||||
|
||||
namespace WorldTraveller
|
||||
{
|
||||
GLOBAL_VAR const i32 NUM_KEYS = 1024;
|
||||
GLOBAL_VAR const i32 METERS_TO_PIXEL = 100;
|
||||
GLOBAL_VAR const f32 METERS_TO_PIXEL = 100;
|
||||
|
||||
enum Cardinal
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user