Advertisement
freelunch

AMH Fix

Sep 17th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub GameOver0()
  2.     Dim X, XX, Y, Z, ZZ, abortLoop, tempSort
  3.     If HSCheck < numPlayers+1 Then
  4.         Debug.Print "Checking HS, cursor POS: " & cursorPOS
  5.         for y=0 To 4                                                                'Check this score against high scores 0 to 4
  6.             Debug.Print "Player: " & cDbl(playerScore(HSCheck)) & " HS check: " & cDbl(highScores(y))
  7.             if (cDbl(playerScore(HSCheck)) >= cDbl(highScores(y))) Then                     'Did player beat this high score?   Equalling it will also bump it down a place
  8.                 Debug.Print "Score higher than " & y
  9. '               playMusic "N", "E"                                              'Only play the music if a player got a high score
  10.                 musicplayer "bgout_ne.mp3"
  11.                 for z=4 To y+1 Step -1                                          'Shift scores down one space below new high score
  12.                     highScores(z) = highScores(z - 1)                          
  13.                     topPlayers((z * 3) + 0) = topPlayers(((z - 1) * 3) + 0)
  14.                     topPlayers((z * 3) + 1) = topPlayers(((z - 1) * 3) + 1)
  15.                     topPlayers((z * 3) + 2) = topPlayers(((z - 1) * 3) + 2)
  16.                 Next
  17.                 for zz = 0 To 4                                                 'Send the newly sorted top 5 scores from RAM to EEPROM
  18.                     setHighScore zz, highScores(zz), topPlayers((zz * 3) + 0), topPlayers((zz * 3) + 1), topPlayers((zz * 3) + 2)
  19.                 Next
  20.                 SaveValue "AMH", "HSPoints" & y, PlayerScore(HSCheck)
  21.                 SaveValue "AMH", "HSName" & y, ""
  22.                 HSPlace = y
  23.                 cursorPos = 0
  24.                 initials(0) = 95                                                'What player has entered (starts as empty spaces)
  25.                 initials(1) = 95
  26.                 initials(2) = 95
  27.                 GotHS = 1
  28.                 nameEntry HSCHeck, HSPlace                                      'Get initials from player, and show which place they got
  29.                 Exit For
  30.             Else
  31.                 GotHS = 0
  32.             End If
  33.         Next
  34.     End If
  35.     If GotHS = 0 Then
  36.         WaLeftSide1.TimerEnabled = 1
  37.     End If 
  38. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement