summaryrefslogtreecommitdiff
path: root/src/entity.h
blob: f9c6a74993ae8912d853fab0a870cac1f7ff584c (plain)
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
#ifndef ENTITY_H
#define ENTITY_H

#include <stdint.h>

#ifndef M_PI
#define M_PI 3.141592f
#endif

struct Entity
{
    float angle;
    float speed;
    float mass;
    float size;
    float x;
    float y;
    uint32_t color;
};

struct Vec2d
{
    float angle;
    float length;
};

struct Vec2d vec2d_add(float angle1, float length1, float angle2, float length2);
void entity_accelerate(struct Entity *e, float angle, float acceleration);

#endif