Joined: 3/25/2004
Posts: 459
DeHackEd wrote:
If they were planning on allowing the player to get more than 127 lives, you'd think they'd use a field 3 digits wide to display the life counter while they were at it. Maybe it was easier to make it a signed variable and no one gave it a second thought.
I realize that the field is only 2 digits wide. Even if the assumed a player would never go over 99, why signed? I can't see how using signed rather than unsigned would be any easier.
TNSe wrote:
After 99 lives it starts using other non-numeric tiles for lives, like crowns and stuff... Ramzi wanted this: http://www.clanvikings.org/tnse/turtleup.zip
lol, thanks. But I did that. As I said in the chat, I could get it to give me a couple men, but then it would stop. The video I was suggesting would be getting 128 men, dying once, and then seeing the game over screen.
Joined: 10/3/2004
Posts: 138
Ramzi wrote:
Why? Why would it be a signed byte, though? If it was unsigned, a player could get 256 men before dying and getting the game over. You can't have negative men. Why did the programmers make that variables signed?
I'd say it was shorter code for the game to use a do a BMI every time after you die, rather than explicitly checking for $FF. In the first instance, it's merely adding a BMI gameover right after the death routine. In the second instance, you'd have CMP #$FF : BEQ gameover which takes two more bytes and a few extra CPU cycles (and back then, two bytes was useful).