diff --git a/player.c b/player.c index 3646a56..5fe067f 100644 --- a/player.c +++ b/player.c @@ -21,6 +21,7 @@ System_Player *player_NewSystem(App *super) { System_Player *sys = malloc(sizeof(System_Player)); sys->super = super; sys->player = NULL; + sys->cutoff = 5000.0; return sys; } void player_DeleteSystem(System_Player *sys) { @@ -152,7 +153,7 @@ void player_Advance(System_Player *sys, Duration deltaTime) { // Respawn if fallen out of the world - if (p->super->position->position.y > 5000) + if (p->super->position->position.y > sys->cutoff) player_HazardHarm(sys); diff --git a/player.h b/player.h index 6ad65eb..4c693e9 100644 --- a/player.h +++ b/player.h @@ -39,6 +39,10 @@ typedef struct { // The player in the world. // Control is paused if equals NULL. Component_Player *player; + + // Cutoff Y position. + // If the player is lower than this position, the player is environment harmed. + double cutoff; } System_Player; System_Player *player_NewSystem(App *super);