Using Hit Counts as a Timer
In this example, you'll see how hit counts can be used as a timer and award an achievement if a condition is true for 10 seconds.
Let's see what Super Hang-On (Mega Drive)'s achievement Speed Freak - Maintain at least 300kph for 10 seconds looks like in the Achievement Editor dialog:
0x0055a: is the speed.
0x0c757: is 0x00 when the game is unpaused.
For this achievement, we are looking for a condition that is met 600 times consecutively. The reason why is that the genesis is locked into processing 60 frames of logic per second (NTSC at least?). And the condition we're checking is "speed is over 300". Also, we want the player to keep the speed above 300 without pausing the game.
player's speed is above 300 for 600 frames (or 10 seconds have passed).
reset the hit counter if the speed goes under 300.
reset the hit counter if the player pauses the game.
Last 10 changes on this page:
[2022-04-18 14:41] S-Flavius:format: grammar
[2019-02-16 19:57] meleu:renamed "Using Hit Counts and ResetIf"