Jump to content
IGNORED

Question about score


Jack Zero

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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) :cool:

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...