aboutsummaryrefslogtreecommitdiffstats
path: root/src/entity.h
blob: 8078cfcd8e761cb7ad24f3007516a00eff787f2a (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
52
53
54
55
56
57
58
#include "utils.h"

// Pretty much any object in the game.

#ifndef ENTITY_H
#define ENTITY_H

#define ENTITY_COUNT 10

#define TREE_SCALE 40.0
#define BUSH_SCALE 3.0
#define FLOWER_SCALE 3.0

#define POND_SIZE 250.0
#define POND_HEIGHT 10.0

#define UTILITY_POLE_HEIGHT 100.0
#define UTILITY_POLE_RADIUS 3.0

#define SAMANTHA_WIDTH 2.65966 / 2.0
#define SAMANTHA_HEIGHT 3.21054 / 2.0
#define SAMANTHA_THICKNESS 1.46845 / 2.0
#define SAMANTHA_STATIC_SPEED 24
#define SAMANTHA_STATIC_FRAMES 4

#define SAMANTHAS_SPOT_SIZE 10
#define SAMANTHAS_SPOT_HEIGHT 5

#define TRASHCAN_SCALE 2.0

typedef int8_t EntityId;

enum {
  ENTITY_NONE = -1,
  OLD_MINT,
  STICKY_NICKEL,
  TREE,
  BUSH,
  FLOWER,
  POND,
  UTILITY_POLE,
  SAMANTHA,
  SAMANTHAS_SPOT,
  TRASHCAN
};

typedef struct {
  EntityId id;
  Vector3 position; // Shouldnt be changed directly.
  BoundingBox box;
} Entity;

Entity createEntity(EntityId id, Vector3 position);
void updateEntity(Entity* entity, Game* game);
void setEntityPosition(Entity* entity, Vector3 position);
void placeEntityOnGround(Entity* entity, const World* world);

#endif