+atari2600land Posted June 2, 2007 Share Posted June 2, 2007 Can anyone explain why, in the following code, does lives=lives-16 gets rid of one life instead of lives=lives-32? And while you're at it, make the cars never stop. bboulevard.bas Quote Link to comment Share on other sites More sharing options...
CurtisP Posted June 3, 2007 Share Posted June 3, 2007 Can anyone explain why, in the following code, does lives=lives-16 gets rid of one life instead of lives=lives-32? And while you're at it, make the cars never stop. The lives variable is actually two variables in one. The top three bits are the number of lives. and the bottom five bits are a pointer to the sprite data, like so: 128 64 32 16 8 4 2 1 | Lives | Pointer | If the pointer data happens to be less than 15, then subtracting sixteen will cause a carry, which will then subtract 1 from the Lives portion. Of course this should also mess up your Pointer and make the sprite look all wrong. Why did you use =16 anyway? Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted June 3, 2007 Author Share Posted June 3, 2007 Why did you use =16 anyway? Because =32 takes away two lives. So, i figured if I used half of 32, it would only take away 1 life. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.