refactor seperate files

This commit is contained in:
huaqo-games
2025-02-03 11:19:50 +01:00
parent 8f1a6200a3
commit 0c73d94187
10 changed files with 313 additions and 315 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef VECTOR_H
#define VECTOR_H
#include <raylib.h>
typedef struct {
Vector2 *data;
size_t count;
} Vector2Array;
bool IsVectorZero(Vector2 v) {
float epsilon = 0.01f;
return (fabs(v.x) < epsilon && fabs(v.y) < epsilon);
}
Vector2 GetRandomVector(const Rectangle bounds) {
return (Vector2){
bounds.x + (float)GetRandomValue(0, 10000) / 10000.0f * bounds.width,
bounds.y + (float)GetRandomValue(0, 10000) / 10000.0f * bounds.height
};
}
#endif // VECTOR_H