animation is now decoupled from sprite

This commit is contained in:
huaqo-games
2025-02-08 17:47:12 +01:00
parent 0c73d94187
commit bcb1577694
7 changed files with 121 additions and 4 deletions
+15
View File
@@ -0,0 +1,15 @@
#ifndef CAMERA_H
#define CAMERA_H
#include <raymath.h>
#include "input.h"
void UpdateCamera2DTarget(Camera2D *camera, Vector2 *position, const float smoothness){
camera->target = Vector2Lerp(camera->target, *position, smoothness * GetFrameTime());
}
void UpdateCamera2DZoom(Camera2D *camera, const float *scaleFactor, const float *minZoom, const float *maxZoom){
float targetZoom = Clamp(camera->zoom * *scaleFactor, *minZoom, *maxZoom);
camera->zoom = Lerp(camera->zoom, targetZoom, 0.1f);
}
#endif // CAMERA_H