218
edits
mNo edit summary |
SuperHamster (talk | contribs) m (→References: List syntax) |
||
Line 30: | Line 30: | ||
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== | ||
* [https://www.youtube.com/watch?v=yvxdLH1ejaA "Blinking" by Pannenkoek2012] | |||
[https://www.youtube.com/watch?v=yvxdLH1ejaA "Blinking" by Pannenkoek2012] | * [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/mario_misc.c#L360 Mario's blinking code] | ||
* [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/mario_actions_cutscene.c#L206 Peach's blinking code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/mario_misc.c#L360 Mario's blinking code] | * [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/bowser.inc.c#L1179 Bowser's Eye code] | ||
* [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/tuxie.inc.c#L286 Penguin blinking code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/mario_actions_cutscene.c#L206 Peach's blinking code] | * [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/obj_behaviors_2.c#L582 Common enemy blinking code] | ||
* [https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/bobomb.inc.c#L215 Bob-omb blinking code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/bowser.inc.c#L1179 Bowser's Eye code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/tuxie.inc.c#L286 Penguin blinking code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/obj_behaviors_2.c#L582 Common enemy blinking code] | |||
[https://github.com/n64decomp/sm64/blob/06ec56df7f951f88da05f468cdcacecba496145a/src/game/behaviors/bobomb.inc.c#L215 Bob-omb blinking code] | |||
[[Category:Mechanics]] | [[Category:Mechanics]] |
edits