-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshare.h
More file actions
110 lines (90 loc) · 1.69 KB
/
share.h
File metadata and controls
110 lines (90 loc) · 1.69 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <raylib.h>
#include <unistd.h>
#include <math.h>
#define MAX_TEXTURES 1000
#define MAX_ANIMATIONS 100
#define MAX_ENEMYS 20
char * load_file (char * file);
int lengthFile = 0;
int amountKeys = 4;
//put all the global structs in here
int screenx, screeny; //screenresolutions
//0 game, 1 overworld
int game_state = 1;
bool paused = false;
//0 up, 1 down, 2 left, 3 right, 4 jump, 5 run, 6 pause
float keys[5];
float delta;
int millitotal, millitimer;
typedef struct{ //vector
float x, y;
} vec;
vec vec_create (float x, float y)
{
vec new_vector = {.x = x, .y = y};
return new_vector;
}
vec vec_add (vec one, vec two)
{
one.x += two.x;
one.y += two.y;
return one;
}
vec vec_addf (vec one, float two)
{
one.x += two;
one.y += two;
return one;
}
vec vec_min (vec one, vec two)
{
one.x -= two.x;
one.y -= two.y;
return one;
}
vec vec_multi (vec one, vec two)
{
one.x *= two.x;
one.y *= two.y;
return one;
}
vec vec_multif (vec one, float two)
{
one.x *= two;
one.y *= two;
return one;
}
vec vec_dev (vec one, vec two)
{
one.x /= two.x;
one.y /= two.y;
return one;
}
vec vec_devf (vec one, float two)
{
one.x /= two;
one.y /= two;
return one;
}
typedef struct{ //vector 4 (colors)
union{
struct { float x, y, z, w};
struct { float r, b, g, a};
float v[4];
};
}vec4;
vec4 vec4_create (float r, float g, float b, float a)
{
vec4 new_vector4 = {.r = r, .g = g, .b = b, .a = a};
return new_vector4;
}
typedef struct //notes
{
int position, timing;
int longTime;
int hit;
}Note;