+
+ switch (player->state) {
+ case PLAYER_STATE_ALIVE: {
+ rigid_rect_update(player->alive_body, platforms, delta_time);
+
+ if (rigid_rect_touches_ground(player->alive_body)) {
+ player->jump_count = 0;
+ }
+
+ const rect_t hitbox = rigid_rect_hitbox(player->alive_body);
+
+ if (hitbox.y > 1000.0f) {
+ player_die(player);
+ }
+ } break;
+
+ case PLAYER_STATE_DYING: {
+ dying_rect_update(player->dying_body, delta_time);
+
+ if (dying_rect_is_dead(player->dying_body)) {
+ player->alive_body = RESET_LT(
+ player->lt,
+ player->alive_body,
+ create_rigid_rect(
+ rect_from_vecs(
+ player->checkpoint,
+ vec(PLAYER_WIDTH, PLAYER_HEIGHT)),
+ player->color));
+ player->state = PLAYER_STATE_ALIVE;
+ }
+ } break;
+
+ default: {}
+ }