summary refs log tree commit diff stats
path: root/src/entity.h
blob: 8d28b98b72b976e44248f3998e0d122eb1db1225 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef ENTITY_H_0D6CB29A
#define ENTITY_H_0D6CB29A

#include "vector.h"

enum class ColliderType {
  player,
  train,
  other
};

enum class Direction {
  none,
  left,
  right,
  up,
  down
};

class Entity {
public:

  // Transform
  vec2s pos;
  vec2s size;

  // Grid placement
  vec2s gridPos;

  // Movement
  Direction shouldMoveTo = Direction::none;
  bool moving = false;
  vec2s destPos;
  double movementTween = 0.0;
  double speed = 0.0; // Tiles per second

  // Player
  bool controllable = false;

  // Collision
  ColliderType colliderType = ColliderType::other;

  bool playerCanPush = false;
  bool trainCanPush = false;
  
  // Temp
  int colorVal = 25;

};

#endif /* end of include guard: ENTITY_H_0D6CB29A */