From: LMH Date: Thu, 8 Aug 2013 00:53:42 +0000 (-1000) Subject: Added a phase factor to dazed icecrusher eye motion so that eyes spin while icecrushe... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e6bf67bc91626645d0ac523f7b78f269040483ec;p=supertux.git Added a phase factor to dazed icecrusher eye motion so that eyes spin while icecrusher is monemtarily sitting on the ground --- diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index 043b7487a..ac06fbc62 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -294,8 +294,16 @@ IceCrusher::eye_position(bool right) else if(state == RECOVERING) { // Eyes spin while icecrusher is recovering, giving a dazed impression - return Vector(sin((right ? 1 : -1) * get_pos().y/13) * sprite->get_width()/64 * 2 - (right ? 1 : -1) * sprite->get_width()/64 * 2, - cos(((right ? 3.1415 : 0) + get_pos().y/13)) * sprite->get_width()/64 * 2 - sprite->get_width()/64 * 2); + return Vector(sin((right ? 1 : -1) * // X motion of each eye is opposite of the other + (get_pos().y/13 - // Phase factor due to y position + (ic_size==NORMAL ? RECOVER_SPEED_NORMAL : RECOVER_SPEED_LARGE) + cooldown_timer*13)) * //Phase factor due to cooldown timer + sprite->get_width()/64 * 2 - (right ? 1 : -1) * // Amplitude dependent on size + sprite->get_width()/64 * 2, // Offset to keep eyes visible + cos((right ? 3.1415 : 0) + // Eyes spin out of phase of eachother + get_pos().y/13 - // Phase factor due to y position + (ic_size==NORMAL ? RECOVER_SPEED_NORMAL : RECOVER_SPEED_LARGE) + cooldown_timer*13) * //Phase factor due to cooldown timer + sprite->get_width()/64 * 2 - // Amplitude dependent on size + sprite->get_width()/64 * 2); // Offset to keep eyes visible } return Vector(0,0);