Dim CountBlocks, CountTime As Long, CountLines As Integer, LinesErased(3) As Integer
Dim LineAnimationColor As Integer
Dim LineAnimation As Boolean
Dim PieceAnimation As Integer
Dim CheatKeys As Integer
Dim CheatActivated As Boolean
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim Grid(9, -2 To 20) As Boolean
Dim GridColor(9, -2 To 20) As Integer
Dim Level As Integer
Dim Speed(20) As Long 'speed of level
Dim NextPiece As Integer
Dim NextPieceGrid(3) As TetrisPiece
Dim Score As Long
Dim xLines As Integer
Dim Paused As Boolean
Dim ScoreDone As Boolean
Dim Gameover As Boolean 'Game Over
Private Sub NewGame()
LineAnimation = False
ScoreDone = False
lblNewgame.Visible = False
lblNewgame2.Visible = False
lblGameover.Visible = False
For a = 0 To 9
For B = -2 To 20
Grid(a, B) = False
Next B
Next a
For a = 0 To 9
For B = 0 To 20
GridColor(a, B) = 0
Next B
Next a
Level = 0
Score = 0
xLines = 0
Gameover = False
Paused = False
lblLevel.Caption = 0
UpdateStats
Randomize
NextPiece = Int(Rnd * 7)
GameLoop
End Sub
Private Sub GameOver2()
Dim msTime2 As Long
Gameover = True
For a = 20 To 0 Step -1
msTime2 = 100 + GetTickCount
For B = 0 To 9
GridColor(B, a) = 7
Next B
DrawGrid
sSoundName = "gameover"
lFlags = SND_RESOURCE + SND_ASYNC + SND_NODEFAULT
If ScoreDone = False Then lRet = PlaySound(sSoundName, hInst, lFlags)
Do
DoEvents
Loop While GetTickCount < msTime2
Next a
lblGameover.Visible = True
CurrentColor = 7
Dim HighScoreName As String
If ScoreDone = False And Score > Int(Val(ReadRegistry(HKEY_LOCAL_MACHINE, "Software/Simplixx", "Score1"))) Then
ScoreDone = True
HighScoreName = InputBox$("You have achieved a high score. Please enter your name.", "High Score", "Anonymous")
BitBlt picGrid.hDC, a * 17, B * 17, 17, 17, picBlocks.hDC, GridColor(a, B) * 17, 0, vbSrcCopy
End If
Next B
Next a
End Sub
Private Sub Form_Load()
MsgBox "COMPILE FIRST!!" & vbCrLf & "This version of Simplixx was released on pscode.com" & vbCrLf & "http://www.chaoticlogic.net/", vbOKOnly Or vbExclamation, "Simplixx"