aboutsummaryrefslogtreecommitdiffstats
path: root/src/entity.h
blob: f647e1451f81df045761bad3b060425fac837609 (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
#include "utils.h"

// Pretty much any object in the game.

#ifndef ENTITY_H
#define ENTITY_H

typedef int8_t EntityId;

#define ENTITY_COUNT 5

// Entity scales.
#define TREE_SCALE 32.0
#define BUSH_SCALE 6.0
#define FLOWER_SCALE 2.0

enum {
  ENTITY_NONE = -1,
  OLD_MINT,
  STICKY_NICKEL,
  TREE,
  BUSH,
  FLOWER
};

typedef struct {
  EntityId id;
  Vector3 position; // Shouldnt be accessed 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