Sub CycleFutureDMD()
If PlayersPlayingGame > 0 then
MyNewDMD.FlushAnimation:MyNewDMD.FlushQueue
MyNewDMD.UpdateInterval = 10
MyNewDMD.QueueText "[edge4][f7][xc][y9]" & FormatNumber (GameWinner, 0, -1, 0, -1) & "[f8][x64][y2]P2: " & FormatNumber(nvscore2, 0, -1, 0, -1) & "[x2][y2]P1: "& FormatNumber(nvscore1, 0, -1, 0, -1) &"[x2][y25]P3: " & FormatNumber(nvscore3, 0, -1, 0, -1) & "[f8][x64][y25]P4: "& FormatNumber(nvscore4, 0, -1, 0, -1), deFlip, 2000, False
MyNewDmd.QueueText "[Edge 4][f7][xc][y9]Table Name", deFlip, 2000, true
MyNewDMD.QueueText "[Edge4][f7][xc][y9]"& nvHighScore1Name & " " &FormatNumber( nvHighScore1, 0, -1, 0, -1) & "[f8][x64][y2]" &nvHighScore2Name & " " &FormatNumber(nvHighScore2, 0, -1, 0, -1) & "[x2][y2]"&nvHighScore1Name & " " & FormatNumber(nvHighScore1, 0, -1, 0, -1) &"[f8][x2][y25]"&nvHighScore3Name & " " & FormatNumber(nvHighScore3, 0, -1, 0, -1) & "[x64][y25]"&nvHighScore4Name & " " & FormatNumber(nvHighScore4, 0, -1, 0, -1), deFlip, 2000, True
MyNewDMD.QueueText "[Edge 4][f7][xc][y9]"& nvHighScore1Name & " " & FormatNumber(nvHighScore1, 0, -1, 0, -1) & "[f8][x2][y25]CREDITS: "& nvCredits & "[f8][x2][y2]HIGHSCORE: " &nvHighScore1Name & "[f8][x78][y2]GAMES: " & nvTotalGamesPlayed &"[f8][x78][y25]PLAYERS: " & PlayersPlayingGame, deFlip, 2000, False
End if
If PlayersPlayingGame = 0 Then
MyNewDMD.FlushAnimation:MyNewDMD.FlushQueue
MyNewDMD.UpdateInterval = 10
MyNewDmd.QueueText "[Edge 4][f7][xc][y9]Table Name", deFlip, 2000, true
MyNewDMD.QueueText "[Edge4][f7][xc][y9]"& nvHighScore1Name & " " &FormatNumber( nvHighScore1, 0, -1, 0, -1) & "[f8][x64][y2]" &nvHighScore2Name & " " &FormatNumber(nvHighScore2, 0, -1, 0, -1) & "[x2][y2]"&nvHighScore1Name & " " & FormatNumber(nvHighScore1, 0, -1, 0, -1) &"[f8][x2][y25]"&nvHighScore3Name & " " & FormatNumber(nvHighScore3, 0, -1, 0, -1) & "[x64][y25]"&nvHighScore4Name & " " & FormatNumber(nvHighScore4, 0, -1, 0, -1), deFlip, 2000, False
End if
End Sub
'------------------------------------------------------------------------------------------------------------
'''Background Animation Routine ""
'
'------------------------------------------------------------------------------------------------------------
''A. Set which background is currently active and turn off others and start the timer/get the animation started/choose starting frame
'6 potential game events : 1.When Game loaded 2.Insert Coint 3.Startgame 4.GoPlayer 5.Active Score 6.Game End
Sub Background1use()
ShutBackgroundsOff()
Background1inuse = True
BackgroundDMDtimer.set false
FontFrame=92' [f1] starting frame number 1. Table Start
BackgroundDMDtimer.set true,50
End Sub
Sub Background2use()
AttractAnimation.Enabled = False
AttractAnimation2.Enabled = False
ShutBackgroundsOff()
Background2inuse = True
BackgroundDMDtimer.set false
FontFrame=72 ' [f2] starting frame number 2.Insert Coin
BackgroundDMDtimer.set true,50
End Sub
Sub Background3use()
AttractAnimation.Enabled = False
AttractAnimation2.Enabled = False
ShutBackgroundsOff()
Background3inuse = True
BackgroundDMDtimer.set false
FontFrame=32'[f3] starting frame number 3.Start Game/Welcome Player
BackgroundDMDtimer.set true,50
End Sub
Sub Background4use()
ShutBackgroundsOff()
Background4inuse = True
BackgroundDMDtimer.set false
FontFrame=107 '[f4] starting frame number 4.GoPlayer
BackgroundDMDtimer.set true,50
End Sub
Sub Background5use()
ShutBackgroundsOff()
Background5inuse = True
BackgroundDMDtimer.set false
FontFrame=107 '[f5] starting frame number 5.Active Score
BackgroundDMDtimer.set true,50
End Sub
Sub Background6use()
ShutBackgroundsOff()
Background6inuse = True
BackgroundDMDtimer.set false
FontFrame=32 '[f6] starting frame number 6. End of Game
BackgroundDMDtimer.set true,50
End Sub
Sub ShutBackgroundsOff()
Background1inuse = False
Background2inuse = False
Background3inuse = False
Background4inuse = False
Background5inuse = False
Background6inuse = False
End Sub
'B. Keep cycling the animation and set which frames are viewed/looped
sub BackgroundDMDtimer_expired
FontFrame=FontFrame+1
If Background1inuse = TRUE Then
if FontFrame>121 then
FontFrame=92 '[f1] Set frame loop Table start
end if
GetBackFonts()
End if
If Background2inuse = TRUE Then
if FontFrame>124 then
FontFrame=72 '[f2] Set frame loop Insert Coin
end if
GetBackFonts()
End if
If Background3inuse = TRUE Then
If FontFrame>83Then
FontFrame=32 '[f3] Set frame loop Start Game Key
End if
GetBackFonts()
End if
If Background4inuse = TRUE Then
If FontFrame>125 Then
FontFrame=107 '[f4] Set frame loop GoPlayer
End if
GetBackFonts()
End if
If Background5inuse = TRUE Then
if FontFrame>125 then
FontFrame=107 '[f5] Set frame loop Active Socre
end if
GetBackFonts()
End if
If Background6inuse = TRUE Then
if FontFrame>58 then
FontFrame=32 '[f6] Set frame loop Game End
end if
GetBackFonts()
End if
end sub
'As name suggests this is to cycle Attract modes with animations
Sub AttractAnimation_Expired()
AttractAnimation.Enabled = False
If PlayersPlayingGame = 0 then
AttractAnimation2.Interval = 19500
AttractAnimation2.Enabled = TRUE
Else
AttractAnimation2.Interval = 33500
AttractAnimation2.Enabled = TRUE
End if
ShutBackgroundsOff()
CycleFutureDMD()
End Sub
Sub AttractAnimation2_Expired()
AttractAnimation2.Enabled = False
AttractAnimation.Interval =3000
AttractAnimation.Enabled = TRUE
Background1use()
End Sub
'C. GetBackFonts() populates the foreground Statistical DMDs with "[f value on animation DMD]&chr(backfont)" added to indicated animation and frame value
Sub GetBackFonts()
If Background1inuse = True Then
MyNewDmd.Text = "[f1][xc][yc]" & chr(FontFrame) &"[Edge 4][f7][xc][y9]INSERT COIN"
'MyNewDmd.Text = "[Edge 4][f8][xc][y9]INSERT COIN"
End if
If Background2inuse = True Then
MyNewDMD.Text = "[f2][xc][yc]"&chr(FontFrame) &"[na][f7][xc][y11]"& FormatNumber(nvHighScore1, 0, -1, 0, -1) & "[f9][x2][y25]CREDITS: "& nvCredits & "[f8][x2][y2]HIGHSCORE: " &nvHighScore1Name & "[f8][x78][y2]GAMES: " & nvTotalGamesPlayed &"[f9][x78][y25]PLAYERS: " & PlayersPlayingGame
'MyNewDMD.Text = "[na][f7][xc][y11]"& FormatNumber(nvHighScore1, 0, -1, 0, -1) & "[f9][x2][y25]CREDITS: "& nvCredits & "[f8][x2][y2]HIGHSCORE: " &nvHighScore1Name & "[f8][x78][y2]GAMES: " & nvTotalGamesPlayed &"[f9][x78][y25]PLAYERS: " & PlayersPlayingGame
End if
If Background3inuse = True Then
MyNewDmd.Text = "[f3][xc][yc]"&chr(FontFrame) &"[f7][xc][y10]WELCOME PLAYER "& PlayersPlayingGame
'MyNewDmd.Text = "[f7][xc][y10]WELCOME PLAYER "& PlayersPlayingGame
End if
If Background4inuse = True Then
MyNewDMD.Text = "[f4][xc][yc]" & chr(FontFrame) &"[edge4][f7][xc][y9]GO PLAYER " & (CurrentPlayer ) & "[f8][x64][y2]P2: " & FormatNumber(nvscore2, 0, -1, 0, -1) & "[x2][y2]P1: "& FormatNumber(nvscore1, 0, -1, 0, -1) &"[f9][x2][y25]P3: " & FormatNumber(nvscore3, 0, -1, 0, -1) & "[x64][y25]P4: "& FormatNumber(nvscore4, 0, -1, 0, -1)
'MyNewDMD.Text = "[edge4][f7][xc][y9]GO PLAYER " & (CurrentPlayer ) & "[f8][x64][y2]P2: " & FormatNumber(nvscore2, 0, -1, 0, -1) & "[x2][y2]P1: "& FormatNumber(nvscore1, 0, -1, 0, -1) &"[f9][x2][y25]P3: " & FormatNumber(nvscore3, 0, -1, 0, -1) & "[x64][y25]P4: "& FormatNumber(nvscore4, 0, -1, 0, -1)
End if
If Background5inuse = True Then
MyNewDMD.Text = "[f5][xc][yc]"&chr(FontFrame) &"[f7][xc][y9]" & FormatNumber (nvscore(CurrentPlayer), 0, -1, 0, -1) & "[f8][x82][y2]LIVES: " & (BallsRemaining(CurrentPlayer)) & "[f8][x2][y2]PLAYER: " & currentplayer & "[f9][x2][y25]LAST PLAYER: " & FormatNumber(nvScore(LastPlayer), 0, -1, 0, -1)
'MyNewDMD.Text = "[f7][xc][y9]" & FormatNumber (nvscore(CurrentPlayer), 0, -1, 0, -1) & "[f8][x82][y2]Balls: " & (BallsRemaining(CurrentPlayer)) & "[f8][x2][y2]PLAYER: " & currentplayer & "[f9][x2][y25]LAST PLAYER: " & FormatNumber(nvScore(LastPlayer), 0, -1, 0, -1)
End if
If Background6inuse = True Then
MyNewDmd.Text = "[f6][xc][yc]"&chr(FontFrame) &"[f7][xc][y10]GAME OVER "
'MyNewDmd.Text = "[f7][xc][y10]GAME OVER "
End if
End Sub
Sub GameWinnerCheck()
If NvScore1 > NvScore2 and NvScore1 > NvScore3 and NvScore1 > NvScore4 Then
GameWinner = NvScore1
End if
If NvScore2 > NvScore1 and NvScore2 > NvScore3 and NvScore2 > NvScore4 Then
GameWinner = NvScore2
End if
If NvScore3 > NvScore1 and NvScore3 > NvScore2 and NvScore3 > NvScore4 Then
GameWinner = NvScore3
End if
If NvScore4 > NvScore1 and NvScore4 > NvScore2 and NvScore4 > NvScore3 Then
GameWinner = NvScore4
End if
End Sub
Sub LastPlayerCheck()
If (PlayersPlayingGame > 1) Then
LastPlayer = CurrentPlayer - 1
End if
If CurrentPlayer = 1 Then
LastPlayer = PlayersPlayingGame
End if
If PlayersPlayingGame = 1 Then
LastPlayer = 1
End if
End Sub