Blinking: Difference between revisions

m
no edit summary
(Revamped page. Mr. I and Eyerokc still need to be finished)
mNo edit summary
Line 22: Line 22:
The Penguins (small and large) use the global timer to control their blinking. The Penguin's blinking timer is taken from the global timer modulo 50. When the timer is greater than 43, the Penguin starts to blink. The Penguin's eyes are partially closed for 2 frames, then closed for 2 frames, then partially closed for 3 frames, and then open again. Thus, the Penguins blink every 50 frames and the animation lasts 7 frames. Since the global timer increments while the game is paused, Penguins will blink even when the game is paused.
The Penguins (small and large) use the global timer to control their blinking. The Penguin's blinking timer is taken from the global timer modulo 50. When the timer is greater than 43, the Penguin starts to blink. The Penguin's eyes are partially closed for 2 frames, then closed for 2 frames, then partially closed for 3 frames, and then open again. Thus, the Penguins blink every 50 frames and the animation lasts 7 frames. Since the global timer increments while the game is paused, Penguins will blink even when the game is paused.


===Goombas===
===Common Enemy===


This system is used by Goombas, Pokeys, Lakitus, Koopas, and Koopa the Quick. This system uses a countdown timer with a randomly generated number. When the countdown timer is below a certain value, the object blinks, and then calls RNG to determine a new number to begin the countdown from. Goombas blink when the countdown is from 5 to 0, and the countdown is reset to a number between 30 and 79. Pokeys blink when the countdown is from 4 to 0, and the countdown is reset to a number between 30 and 89. Lakitus blink when the countdown is from 4 to 0, and the countdown is reset to a number between 20 and 59. Koopas blink when the countdown is from 4 to 0, and the countdown is reset to a number between 20 and 69. Koopa the Quick blinks when the countdown is from 3 to 0, and the countdown is reset to a number between 10 and 24.
This system is used by Goombas, Pokeys, Lakitus, Koopas, and Koopa the Quick. This system uses a countdown timer with a randomly generated number. When the countdown timer is below a certain value, the object blinks, and then calls RNG to determine a new number to begin the countdown from. Goombas blink when the countdown is from 5 to 0, and the countdown is reset to a number between 30 and 79. Pokeys blink when the countdown is from 4 to 0, and the countdown is reset to a number between 30 and 89. Lakitus blink when the countdown is from 4 to 0, and the countdown is reset to a number between 20 and 59. Koopas blink when the countdown is from 4 to 0, and the countdown is reset to a number between 20 and 69. Koopa the Quick blinks when the countdown is from 3 to 0, and the countdown is reset to a number between 10 and 24.


===Bob-omb===
===RNG===


This system is used by Bob-ombs and Yoshi. Bob-ombs call RNG every frame to determine if they should blink. Specifically, it calls for a random float between 0 and 1, which is then multiplied by 100 and cast to an integer. If the integer it is cast to is 0 (the random float is less than 1/100), the Bob-omb begins its blinking animation. The animation lasts 15 frames, after which the game calls for RNG again. Thus, Bob-ombs and Yoshi will blink about once every 100 frames on average. However, since this is completely based on RNG, in practice this can be made much shorter or longer with RNG manipulation.
This system is used by Bob-ombs and Yoshi. Bob-ombs call [[RNG]] every frame to determine if they should blink. Specifically, it calls for a random float between 0 and 1, which is then multiplied by 100 and cast to an integer. If the integer it is cast to is 0 (the random float is less than 1/100), the Bob-omb begins its blinking animation. The animation lasts 15 frames, after which the game calls for RNG again. Thus, Bob-ombs and Yoshi will blink about once every 100 frames on average. However, since this is completely based on RNG, in practice this can be made much shorter or longer with RNG manipulation.
==References==
==References==