This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

1-Up Polling

1-Up Polling
by on (#144126)
I was just wondering what are some ways that you guys have polled to see if the player should be rewarded with a 1-up? The way I came up with is limited to how many extra men can be obtained:

http://pastebin.com/53QjaXMy

It gives a free man at 20,000, then at 50,000 and every 50,000 more thereafter until 1 million. After that, the player would receive no more extra men. In the game we're finishing up right now, it's highly doubtful that the player will get to 1 million points, even with successive playthroughs after beating the game the first time (each time you loop the game the enemies become more difficult).

I was just wondering what ways some others have come up with to check when the player needs a 1-up when going by score?
Re: 1-Up Polling
by on (#144136)
Roth wrote:
In the game we're finishing up right now, it's highly doubtful that the player will get to 1 million points

So I guess you wouldn't want to implement the "Congratulations, you are fags" screen from that one episode of South Park.

Quote:
I was just wondering what ways some others have come up with to check when the player needs a 1-up when going by score?

The trope page is Every Ten Thousand Points.
Re: 1-Up Polling
by on (#144157)
Roth wrote:
I was just wondering what ways some others have come up with to check when the player needs a 1-up when going by score?
What I have done once is to double how many points you need each time.
Re: 1-Up Polling
by on (#144158)
Roth wrote:
I was just wondering what ways some others have come up with to check when the player needs a 1-up when going by score?
Galaxian stores the current score in unpacked BCD, and handles 1ups in the BCD addition routine. So if you do that, whenever the 1000s digit carries and the 10000s digit becomes 5 or 0.
Re: 1-Up Polling
by on (#144274)
tepples wrote:
So I guess you wouldn't want to implement the "Congratulations, you are fags" screen from that one episode of South Park.

Probably not! haha

lidnariq wrote:
Galaxian stores the current score in unpacked BCD, and handles 1ups in the BCD addition routine. So if you do that, whenever the 1000s digit carries and the 10000s digit becomes 5 or 0.

I was trying to think of a way of doing something like checking when the ten-thousand slot became a 5 or 0, but couldn't think of anything really elegant. I will have to keep that in mind for the future.
Re: 1-Up Polling
by on (#144534)
The simplest and most general solution I can think of would be to store a variable in RAM containing the next score threshold to cross, and as often as necessary check if the current score is greater than it. If so, give the player the corresponding bonus and update the threshold however you please. In pseudocode, that would be something like this:
Code:
if(score >= nextLevel)
   Give a bonus
   Update nextLevel
else
   Do Nothing