User Tools

Site Tools


base:high_score_detection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:high_score_detection [2015-04-17 04:32] (current)
Line 1: Line 1:
 +====== Highscore detection ======
 +
 +When I was coding games, like Bomb Chase 2007, etc. I wanted to add a high score detection routine. This example below shows how the high score detection works using 6 chars on screen, when using number chars on a game screen. :)
 +
 +<​code>​
 +                        lda playerscore+0
 + sec
 + lda hiscore1+5
 + sbc playerscore+5
 + lda hiscore1+4
 + sbc playerscore+4
 + lda hiscore1+3
 + sbc playerscore+3
 + lda hiscore1+2
 + sbc playerscore+2
 + lda hiscore1+1
 + sbc playerscore+1
 + lda hiscore1+0
 + sbc playerscore+0
 + bpl nohiscore
 +                        jmp newhiscore
 +
 +nohiscore: ​             ;Rest of program
 +
 +newhiscore: ​            ;Rest of program ​
 +
 +</​code>​
 +
 +
  
base/high_score_detection.txt ยท Last modified: 2015-04-17 04:32 (external edit)