diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sdl/draw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sdl/draw.c b/src/sdl/draw.c index 4209016..784601d 100644 --- a/src/sdl/draw.c +++ b/src/sdl/draw.c @@ -145,12 +145,16 @@ get_home_angle( const draw_ctx_t * const draw_ctx ) { if (draw_ctx->state == GAME_STATE_SOLVE) { + // solving (low shake) return 5 * sin(draw_ctx->ticks * M_2_PI / 2000.0); } else if (sok_ctx_is_done(draw_ctx->ctx)) { + // won level (moderate shake) return 10 * sin(draw_ctx->ticks * M_2_PI / 1000.0); } else if ((draw_ctx->ticks - draw_ctx->bump_ticks) < BUMP_TIME) { + // bumped into wall, undo failed (high shake) return 10 * sin(draw_ctx->ticks * M_2_PI / (BUMP_TIME / 2.0)); } else { + // normal (no shake) return 0; } } |