Misc. and faster camera.

This commit is contained in:
KikooDX 2021-01-09 10:34:00 +01:00
parent c0633f4346
commit 493eacdf55
3 changed files with 6 additions and 6 deletions

@ -1 +1 @@
Subproject commit 223dc7e0760db94480125e9ada8c6a381f56f08a
Subproject commit 9fa29497dadf8f5546b6606aa2cd60cbe1f1b8ee

View File

@ -19,6 +19,10 @@ void camera_step(Camera *camera) {
}
void camera_init(Camera *camera, Player *player, const Level *level) {
/* initialize struct */
camera->pos = (Vec){ DWIDTH * VEC_PRECISION, DHEIGHT * VEC_PRECISION };
camera->target = &player->pos;
camera->speed = 0.04;
/* NOTE: This system doesn't totally works, but it's good enough
* for now. TODO: Add informations about what isn't working
* correctly and/or fix the issues.

View File

@ -44,11 +44,7 @@ int play_level(uint level_id) {
level_set(&level, level_id);
/* create camera */
Camera camera = {
.pos = {DWIDTH * VEC_PRECISION, DHEIGHT * VEC_PRECISION},
.target = &player.pos,
.speed = 0.02
};
Camera camera;
camera_init(&camera, &player, level);
/* create input manager */