diff --git a/src/main.c b/src/main.c index 710ab7e..56e2d90 100644 --- a/src/main.c +++ b/src/main.c @@ -101,7 +101,7 @@ void fish_update(const struct app *app, struct fish *fish, float delta_time) fish->wander_target_y = rand() % height; fish->wander_start_x = fish->x; fish->wander_start_y = fish->y; - fish->wander_step = 0.1; + fish->wander_step = 0; fish->state = FISH_STATE_WANDER_TRANSITION; } break; @@ -114,8 +114,9 @@ void fish_update(const struct app *app, struct fish *fish, float delta_time) } if (fish->wander_step >= 1.0) { fish->state = FISH_STATE_WANDER_DONE; + break; } - fish->wander_step += 0.05 * delta_time; + fish->wander_step += 0.1 * delta_time; } break; case FISH_STATE_WANDER_DONE: { @@ -207,6 +208,7 @@ void app_loop(struct app *app) { if (event.type == SDL_QUIT) { break; } + prev_ticks = current_ticks; { SDL_Delay(1);