-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.h
More file actions
64 lines (54 loc) · 1.12 KB
/
core.h
File metadata and controls
64 lines (54 loc) · 1.12 KB
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
59
60
61
62
63
64
#pragma once
#include "raylib.h"
typedef enum {
DEFAULT,
JUMPER,
BOUNCY
} PlatformType;
typedef struct {
Vector2 position;
Vector2 size;
} MyTransform;
typedef struct {
MyTransform transform;
Vector2 velocity;
float desired_horizontal_speed;
float max_horizontal_speed;
float horizontal_steering_force;
float jump_velocity;
bool wants_to_jump;
bool wants_to_drop;
bool is_grounded;
} Player;
typedef struct {
PlatformType type;
MyTransform transform;
} Platform;
typedef struct {
float ground_level;
float gravity_force;
Platform* platforms;
int platform_count;
} LevelInfo;
typedef struct{
const char* path;
Texture2D texture;
} Resource;
typedef struct {
Resource player;
Resource platform;
Resource platform_jumper;
Resource platform_bouncy;
} ResourceContainer;
typedef struct {
bool manual_mode;
bool should_step_forward;
} Debugging;
typedef struct{
ResourceContainer resources;
Player player;
Vector2 camera_position;
LevelInfo level_info;
float simulation_step;
Debugging debugging;
} GameState;