Hacker News new | ask | show | jobs
by derefr 3338 days ago
The NES/SNES era had a lot of games that use sprite animation state/OAM memory as the canonical place to hold the current state of something. Often even important, high-level pieces of game business-logic state, were just left as sprite attributes on particular sprites.

Two examples from Super Mario World (which loves this technique):

• You can avoid dying from running out of time in SMW, by simply getting a power-up right as the level timer reaches zero. The level timer just changes the Mario sprite's animation to STATE_DYING (once, when transitioning from 1 to 0); so if you can get the sprite to play a different animation, the game forget that the player was supposed to be dead.

• The "null sprite" glitch: Yoshi 'carries around' enemies in his mouth by just 1. marking the enemy sprite as invisible and intangible, and then 2. storing a pointer to said enemy sprite. If you can get that sprite to unload from OAM memory and get something else to take its place, then when Yoshi goes to spit the enemy out, he'll instead spit out whatever random garbage is now at the OAM location referenced by the pointer.