summaryrefslogtreecommitdiff
path: root/include/game.h
blob: 9f44f46e17ee46346024938870455d54c1ff8375 (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
31
32
33
34
35
36
37
38
39
#pragma once

#include <raylib.h>
#include <stdint.h>

#include "constants.h"

#define ENTITY_ALLOCATED 1
#define ENTITY_VISIBLE (1 << 1)
#define ENTITY_PHYSICS_ACTIVE (1 << 2)

typedef enum EntityType {
    Player_Entity
} EntityType;

typedef struct Entity {
    int id;
    EntityType type;
    uint16_t flags;

    Vector2 position;
    
    //Physics information
    Rectangle collider;
    int numHitBoxes;
    Rectangle hitBoxes[MAX_AREA_COUNT];
    int numHurtBoxes;
    Rectangle hurtBoxes[MAX_AREA_COUNT];
} Entity;

typedef struct Game {
    bool paused;

    Entity entities[MAX_ENTITY_COUNT];
} Game;

void InitGame();
void UpdateGame(float deltaTime);
void DrawGame();