Hey JP, I found a bug. The attract mode timer has a 3 second delay before it starts, so the player technically has time to input to start a new game before the attract mode starts, so attract mode will overlap with a New Game because the call to kill attract mode happens before attract mode starts.
I fixed it by adding
Dim bAttractMode
near the beginning of the script, then adding another condition for the start game key
If keycode = StartGameKey Then
If(bFreePlay = TRUE) And (bAttractMode = TRUE) Then
If(BallsOnPlayfield = 0) Then
ResetForNewGame()
End If
Else
If(Credits > 0) And (bAttractMode = TRUE) Then
If(BallsOnPlayfield = 0) Then
Credits = Credits - 1
ResetForNewGame()
End If
Else
' Not Enough Credits to start a game.
DMDFlush
DMD CenterLine(0, "CREDITS " & Credits), CenterLine(1, "INSERT COIN"), "", eNone, eBlink, eNone, 500, TRUE, ""
ShowTableInfo
End If
End If
End If
and adding the corresponding
Sub StartAttractMode(dummy)
PlaySong "m_attract"
StartLightSeq
DMDFlush
ShowTableInfo
bAttractMode = TRUE
End Sub
Sub StopAttractMode
DMDFlush
LightSeqAttract.StopPlay
LightSeqFlasher.StopPlay
StopSong
bAttractMode = FALSE
End Sub