diff options
author | Simponic <loganthebean222@gmail.com> | 2020-08-11 22:13:56 -0600 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-08-11 22:13:56 -0600 |
commit | 723f879f85f25c2d466146e08261e0ae993c72b6 (patch) | |
tree | 185f367c712554f92c14b0074503ff0667e098c3 /source/camera.c | |
parent | e84e232f8d003f3cf3340517d8bf6b65ba430143 (diff) | |
download | geometry-dash-gba-723f879f85f25c2d466146e08261e0ae993c72b6.tar.gz geometry-dash-gba-723f879f85f25c2d466146e08261e0ae993c72b6.zip |
Added basic camera controls
Diffstat (limited to 'source/camera.c')
-rw-r--r-- | source/camera.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/camera.c b/source/camera.c new file mode 100644 index 0000000..c905d74 --- /dev/null +++ b/source/camera.c @@ -0,0 +1,15 @@ +#include "../include/camera.h" + +CAMERA createCamera (int x, int y) { + // Create camera from a point + CAMERA temp; + temp.x = x; + temp.y = y; + return temp; +} + +void applyCameraShift (CAMERA *camera, int *x, int *y) { + // Apply camera shift to a coordinate + *x = *x - camera->x; + *y = *y - camera->y; +} |