Add hurt, die animation when taking damage
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <raylib.h>
|
||||
#include <breeze.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static Rectangle getCameraBounds(Camera2D camera) {
|
||||
Rectangle bounds = {
|
||||
@@ -18,6 +19,12 @@ static Rectangle getCameraBounds(Camera2D camera) {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/13408990/how-to-generate-random-float-number-in-c
|
||||
static inline f32 randFloatRange(f32 min, f32 max) {
|
||||
float scale = rand() / (float) RAND_MAX; /* [0, 1.0] */
|
||||
return min + scale * ( max - min ); /* [min, max] */
|
||||
}
|
||||
|
||||
// Implemented in main.c
|
||||
bool serializeGameData(const char *path, const GameData *gameData);
|
||||
bool deserializeGameData(const char *path, GameData *gameData);
|
||||
|
||||
Reference in New Issue
Block a user