diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-01-23 09:02:57 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-01-23 09:02:57 -0500 |
commit | 8506409d8a7d07a3e3fc13eac74b2c0dc21e4743 (patch) | |
tree | 049ba48fa4941816ede981610f67364c3f400a94 /src | |
parent | 57d7bdc68b774c1e55ebc281786b93c7336eb4e4 (diff) | |
download | sok-8506409d8a7d07a3e3fc13eac74b2c0dc21e4743.tar.bz2 sok-8506409d8a7d07a3e3fc13eac74b2c0dc21e4743.zip |
add get_home_angle() comments
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; } } |