| 144 | } |
| 145 | |
| 146 | static void bubbleUpdate(bubble_t* bubble) |
| 147 | { |
| 148 | // Float up the screen. |
| 149 | bubble->y -= 2; |
| 150 | |
| 151 | // Check if faded away, then reset if gone. |
| 152 | if (bubble->fade < 10) |
| 153 | { |
| 154 | bubble->x = rand() % 400; |
| 155 | bubble->y = 470 + (rand() % 10); |
| 156 | bubble->z = randf(); |
| 157 | bubble->angle = randf(); |
| 158 | bubble->angv = 0.02f*randf(); |
| 159 | bubble->fade = 15; |
| 160 | } |
| 161 | // Check if too far up screen and start fizzling away. |
| 162 | else if (bubble->y < 172) |
| 163 | bubble->fade -= 10; |
| 164 | // Otherwise make sure the bubble is visible. |
| 165 | else if (bubble->fade < 255) |
| 166 | bubble->fade += 10; |
| 167 | |
| 168 | bubble->angle += bubble->angv; |
| 169 | bubble->angleSin = sinf(M_TAU*bubble->angle); |
| 170 | } |
| 171 | |
| 172 | static bool checkLogoAdv(u32 down) |
| 173 | { |
no test coverage detected