Jack Zero Posted December 8, 2005 Share Posted December 8, 2005 Is there a way to apply an if/then statement to score without breaking into assembly? For example subtracting 50 from the score only if it is currently > 50. I don't want losing a ship right away to cause a record score of 999950... IF SCORE > 50 THEN SCORE = SCORE - 50 doesn't seem to work. Any ideas? Quote Link to comment Share on other sites More sharing options...
+batari Posted December 8, 2005 Share Posted December 8, 2005 Is there a way to apply an if/then statement to score without breaking into assembly? For example subtracting 50 from the score only if it is currently > 50. I don't want losing a ship right away to cause a record score of 999950... IF SCORE > 50 THEN SCORE = SCORE - 50 doesn't seem to work. Any ideas? 978570[/snapback] Arithmetic with the score is a special case for the compiler since the score is 3 BCD bytes. If you use "score" in an if-then like that, you will just get the first two digits in BCD. So one way to do what you want might be: score=score-50:if score=$99 then score=0 I haven't tested it, but I think it will work. Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted December 8, 2005 Share Posted December 8, 2005 Hi there! Just a short sidenote from a "Game Design" point of view: Decreasing the score in a game usually sucks. Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
Jack Zero Posted December 8, 2005 Author Share Posted December 8, 2005 Arithmetic with the score is a special case for the compiler since the score is 3 BCD bytes. If you use "score" in an if-then like that, you will just get the first two digits in BCD. So one way to do what you want might be: score=score-50:if score=$99 then score=0 I haven't tested it, but I think it will work. 978583[/snapback] Yes! Just tried that and it works good. From a game design standpoint, losing score points != pleasant.. This is more of a See If I Can Do It project than anything else. Something impossible before Batari Basic.. (and if it ends up nice maybe I'll have a cart made for myself) 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.