Option Explicit Dim i As Integer Dim time_hour, time_minute, time_second As Integer
Private Sub Form_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 105 Call turn(next_block_kind) Case 106 Call move_left(next_block_kind) Case 108 Call move_right(next_block_kind) Case 107 Call down_block(next_block_kind) End Select End Sub
Public Sub Form_Load() Timer_speed.Enabled = False Call image_position '排列方块 Call face '设置窗体属性 bx = 3 by = 0 Label_hour.Caption = 0 Label_minute.Caption = 0 'Call next_block next_block_kind = 7 Timer_speed.Enabled = True Me.KeyPreview = True End Sub
Private Sub menu_about_Click() Load about about.Visible = True End Sub
Private Sub timer_now_Timer() '计时 time_second = time_second + 1 If time_second = 60 Then time_minute = time_minute + 1 time_second = 0 Label_minute.Caption = time_minute End If If time_minute = 60 Then time_hour = time_hour + 1 time_minute = 0 Label_hour.Caption = time_hour End If Label_second.Caption = time_second End Sub Private Sub Timer_speed_Timer() Call down_block(next_block_kind) End Sub Option Explicit Public bx, by As Integer Public next_block_kind As Integer Public p As Integer Public q As Integer Public a As Integer Public n As Integer Public m As Integer
'Public turn_kind As Integer
Sub show1(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show2(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 12).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show3(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show4(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 12).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show5(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 12).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show6(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 12).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show7(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 3).Visible = True End Sub Sub show8(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True End Sub Sub show9(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 21).Visible = True End Sub Sub show10(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 21).Visible = True End Sub Sub show11(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True End Sub Sub show12(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True End Sub Sub show13(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True End Sub Sub show14(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 12).Visible = True End Sub Sub show15(X, Y As Integer) Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 21).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True End Sub Sub show16(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 11).Visible = True Form_main.Image_block(Y * 10 + X + 21).Visible = True End Sub Sub show17(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 1).Visible = True Form_main.Image_block(Y * 10 + X + 2).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True End Sub Sub show18(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True Form_main.Image_block(Y * 10 + X + 21).Visible = True End Sub Sub show19(X, Y As Integer) Form_main.Image_block(Y * 10 + X).Visible = True Form_main.Image_block(Y * 10 + X + 10).Visible = True Form_main.Image_block(Y * 10 + X + 20).Visible = True Form_main.Image_block(Y * 10 + X + 30).Visible = True End Sub Sub next_block() '产生下一个方块(random) Randomize next_block_kind = Int((19 * Rnd) + 1) Call is_full(next_block_kind) End Sub Sub down_block(block_k As Integer) '方块下落,慢 Call fall_buttom(block_k) Select Case block_k Case 1 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False by = by + 1 Call show1(bx, by) Case 2 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False by = by + 1 Call show2(bx, by) Case 3 Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False by = by + 1 Call show3(bx, by) Case 4 Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False by = by + 1 Call show4(bx, by) Case 5 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False by = by + 1 Call show5(bx, by) Case 6 Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False by = by + 1 Call show6(bx, by) Case 7 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 3).Visible = False by = by + 1 Call show7(bx, by) Case 8 Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False by = by + 1 Call show8(bx, by) Case 9 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False by = by + 1 Call show9(bx, by) Case 10 Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False by = by + 1 Call show10(bx, by) Case 11 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False by = by + 1 Call show11(bx, by) Case 12 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False by = by + 1 Call show12(bx, by) Case 13 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False by = by + 1 Call show13(bx, by) Case 14 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False by = by + 1 Call show14(bx, by) Case 15 Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False by = by + 1 Call show15(bx, by) Case 16 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False by = by + 1 Call show16(bx, by) Case 17 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False by = by + 1 Call show17(bx, by) Case 18 Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False by = by + 1 Call show18(bx, by) Case 19 Form_main.Image_block(by * 10 + bx).Visible = False by = by + 1 Call show19(bx, by) End Select End Sub Sub clear(b_kinds As Integer, now_y As Integer) '满行后清行 ' Dim i As Integer 'Dim q As Integer Select Case b_kinds Case 1, 2, 3, 4, 5, 6, 12, 14, 17 p = 1 Case 7 p = 0 Case 8, 9, 10, 11, 13, 16, 15, 18 p = 2 Case 19 p = 3 End Select For q = 0 To p If canClear(now_y + q) Then Call clearOneLine(now_y + q) End If Next End Sub Function canClear(l As Integer) As Boolean 'Dim a As Integer For a = (l * 10 + 0) To (l * 10 + 9) If Form_main.Image_block(a).Visible = False Then canClear = False Exit Function End If Next canClear = True End Function Sub clearOneLine(lineNum As Integer) 'Dim n As Integer 'Dim m As Integer For n = lineNum To 1 Step -1 For m = 0 To 9 Form_main.Image_block(n * 10 + m).Visible = Form_main.Image_block((n - 1) * 10 + m).Visible Next Next End Sub
Sub is_full(block_end As Integer) '是否游戏结束 Select Case block_end Case 1 '田字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 2 'Z字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Or Form_main.Image_block(by * 10 + 15).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 3 '反Z字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 4 '土字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 5 'L字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 6 '反L字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 7 '一字型 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 8 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 9 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 10 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 11 '一 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 12 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 13 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 14 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 15 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 16 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 17 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 18 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If Case 19 If Form_main.Image_block(by * 10 + 3).Visible = True Or Form_main.Image_block(by * 10 + 4).Visible = True Or Form_main.Image_block(by * 10 + 13).Visible = True Or Form_main.Image_block(by * 10 + 14).Visible = True Then Form_main.Timer_speed.Enabled = False Form_main.timer_now.Enabled = False MsgBox "游戏结束!^_^" Else Form_main.Timer_speed = True End If End Select End Sub Sub fall_buttom(block_l As Integer) '是否达到底部 Select Case block_l Case 1 '正方形 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 2 'Z字形 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 10).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible = True Or Form_main.Image_block(by * 10 + bx + 22).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 3 '反Z字型 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 12).Visible = True Or Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 4 '土字型 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 21).Visible = True Or Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 22).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 5 'L字型 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 21).Visible = True Or Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 22).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 6 '反L字型 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 21).Visible = True Or Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 22).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 7 '一字型 If by = 16 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 10).Visible = True Or Form_main.Image_block(by * 10 + bx + 11).Visible = True Or Form_main.Image_block(by * 10 + bx + 12).Visible = True Or Form_main.Image_block(by * 10 + bx + 13).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 8 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 30).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 9 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 31).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 10 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 31).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 11 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 30).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 12 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 10).Visible = True Or Form_main.Image_block(by * 10 + bx + 21).Visible = True Or Form_main.Image_block(by * 10 + bx + 12).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 13 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 30).Visible = True Or Form_main.Image_block(by * 10 + bx + 11).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 14 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 10).Visible = True Or Form_main.Image_block(by * 10 + bx + 11).Visible = True Or Form_main.Image_block(by * 10 + bx + 22).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 15 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 30).Visible = True Or Form_main.Image_block(by * 10 + bx + 31).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 16 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 10).Visible = True Or Form_main.Image_block(by * 10 + bx + 31).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 17 If by = 15 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 20).Visible = True Or Form_main.Image_block(by * 10 + bx + 11).Visible = True Or Form_main.Image_block(by * 10 + bx + 12).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 18 If by = 14 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 30).Visible = True Or Form_main.Image_block(by * 10 + bx + 31).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If Case 19 If by = 13 Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block ElseIf Form_main.Image_block(by * 10 + bx + 40).Visible = True Then Call clear(block_l, by) bx = 3 by = 0 Form_main.Timer_speed.Enabled = False Call next_block Else End If End Select End Sub Sub add_score()
End Sub Sub add_level()
End Sub Sub block_play(block_kind As Integer) '显示于play_field的方块 Select Case block_kind Case 2 Call show2(bx, by) 'Z字型 Case 3 Call show3(bx, by) '反Z字型 Case 4 Call show4(bx, by) '土字型 Case 5 Call show5(bx, by) 'L字型 Case 6 Call show6(bx, by) '反L字型 Case 7 Call show7(bx, by) '一字型 Case 1 Call show1(bx, by) '正方形 Case 8 Call show8(bx, by) Case 9 Call show9(bx, by) Case 10 Call show10(bx, by) Case 11 Call show11(bx, by) Case 12 Call show12(bx, by) Case 13 Call show13(bx, by) Case 14 Call show14(bx, by) Case 15 Call show15(bx, by) Case 16 Call show16(bx, by) Case 17 Call show17(bx, by) Case 18 Call show18(bx, by) Case 19 Call show19(bx, by) End Select End Sub Sub move_left(move_left_kind) Select Case move_left_kind Case 1 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx - 1 Call show1(bx, by) End If End If Case 2 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 10).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx - 1 Call show2(bx, by) End If End If Case 3 'ok If Form_main.Image_block(by * 10 + bx).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx - 1 Call show3(bx, by) End If End If Case 4 'ok If Form_main.Image_block(by * 10 + bx).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx - 1 Call show4(bx, by) End If End If Case 5 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx - 1 Call show5(bx, by) End If End If Case 6 If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx - 1 Call show6(bx, by) End If End If Case 7 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 3).Visible = False bx = bx - 1 Call show7(bx, by) End If End If Case 8 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show8(bx, by) End If End If Case 9 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show9(bx, by) End If End If Case 10 'ok If Form_main.Image_block(by * 10 + bx).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show10(bx, by) End If End If Case 11 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show11(bx, by) End If End If Case 12 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 10).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx - 1 Call show12(bx, by) End If End If Case 13 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show13(bx, by) End If End If Case 14 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx - 1 Call show14(bx, by) End If End If Case 15 'ok If Form_main.Image_block(by * 10 + bx).Visible = False And Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show15(bx, by) End If End If Case 16 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show16(bx, by) End If End If Case 17 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx - 1 Call show17(bx, by) End If End If Case 18 'ok If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show18(bx, by) End If End If Case 19 If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False And Form_main.Image_block(by * 10 + bx + 29).Visible = False Then If bx >= 1 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False bx = bx - 1 Call show19(bx, by) End If End If End Select End Sub Sub move_right(move_right_kind As Integer) Select Case move_right_kind Case 1 'ok If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show1(bx, by) End If End If Case 2 'ok If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx + 1 Call show2(bx, by) End If End If End If Case 3 'ok If Form_main.Image_block(by * 10 + bx + 3).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show3(bx, by) End If End If Case 4 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show4(bx, by) End If End If End If Case 5 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show5(bx, by) End If End If End If Case 6 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 3).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show6(bx, by) End If End If End If Case 7 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 4).Visible = False Then If bx < 6 Then Form_main.Image_block(by * 10 + bx).Visible = False bx = bx + 1 Call show7(bx, by) End If End If End If Case 8 If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx + 1 Call show8(bx, by) End If End If Case 9 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx + 1 Call show9(bx, by) End If End If End If Case 10 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx + 1 Call show10(bx, by) End If End If End If Case 11 If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx + 1 Call show11(bx, by) End If End If Case 12 If Form_main.Image_block(by * 10 + bx + 3).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx + 1 Call show12(bx, by) End If End If Case 13 If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx + 1 Call show13(bx, by) End If End If Case 14 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 3).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False bx = bx + 1 Call show14(bx, by) End If End If End If Case 15 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx + 1 Call show15(bx, by) End If End If End If Case 16 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx + 1 Call show16(bx, by) End If End If End If Case 17 If Form_main.Image_block(by * 10 + bx + 3).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then If bx < 7 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show17(bx, by) End If End If Case 18 If (by * 10 + bx + 22) < 169 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then If bx < 8 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx + 1 Call show18(bx, by) End If End If End If Case 19 If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False And Form_main.Image_block(by * 10 + bx + 31).Visible = False Then If bx < 9 Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False bx = bx + 1 Call show19(bx, by) End If End If End Select 'Form_main.Timer_speed.Enabled = True End Sub Sub turn(turn_kind As Integer) Select Case turn_kind Case 1 Case 2 If by * 10 + bx + 21 < 169 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False bx = bx + 1 Call show8(bx, by) next_block_kind = 8 End If End If Case 3 If by * 10 + bx + 22 < 169 Then If Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False bx = bx + 1 Call show9(bx, by) next_block_kind = 9 End If End If Case 4 If by * 10 + bx + 21 < 169 Then If Form_main.Image_block(by * 10 + bx + 21).Visible = False Then Form_main.Image_block(by * 10 + bx + 12).Visible = False Call show10(bx, by) next_block_kind = 10 End If End If Case 5 If by * 10 + bx + 21 < 169 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False Call show15(bx, by) next_block_kind = 15 End If End If Case 6 If by * 10 + bx + 21 < 169 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 11).Visible = False bx = bx + 1 Call show16(bx, by) next_block_kind = 16 End If End If Case 7 If by * 10 + bx + 21 < 169 Then If Form_main.Image_block(by * 10 + bx - 9).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 21).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 3).Visible = False bx = bx + 1 by = by - 1 Call show19(bx, by) next_block_kind = 19 End If End If Case 8 If by * 10 + bx + 20 < 169 And bx >= 1 Then If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show2(bx, by) next_block_kind = 2 End If Else If Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx).Visible = False Then Form_main.Image_block(by * 10 + bx + 10).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Call show2(bx, by) next_block_kind = 2 End If End If Case 9 If by * 10 + bx + 20 < 169 And bx >= 1 Then If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx + 11).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show3(bx, by) next_block_kind = 3 End If Else If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 2).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False Call show3(bx, by) next_block_kind = 3 End If End If Case 10 If by * 10 + bx + 21 < 169 And bx <= 7 Then If Form_main.Image_block(by * 10 + bx + 12).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False by = by + 1 Call show12(bx, by) next_block_kind = 12 End If Else If Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False by = by + 1 bx = bx - 1 Call show12(bx, by) next_block_kind = 12 End If End If Case 11 If by * 10 + bx + 20 < 169 And bx >= 1 Then If Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show4(bx, by) next_block_kind = 4 End If Else If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx).Visible = False Call show4(bx, by) next_block_kind = 4 End If End If Case 12 If Form_main.Image_block(by * 10 + bx - 9).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False by = by - 1 bx = bx + 1 Call show11(bx, by) next_block_kind = 11 End If Case 13 If by * 10 + bx + 21 < 169 And bx >= 1 Then If Form_main.Image_block(by * 10 + bx - 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False bx = bx - 1 Call show5(bx, by) next_block_kind = 5 End If Else If Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Call show5(bx, by) next_block_kind = 5 End If End If Case 14 If by * 10 + bx + 12 < 169 Then If Form_main.Image_block(by * 10 + bx - 9).Visible = False And Form_main.Image_block(by * 10 + bx - 8).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False Form_main.Image_block(by * 10 + bx + 12).Visible = False by = by - 1 bx = bx + 1 Call show13(bx, by) next_block_kind = 13 End If End If Case 15 If by * 10 + bx + 22 < 169 And bx <= 7 Then If Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 22).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False by = by + 1 Call show14(bx, by) next_block_kind = 14 End If Else If Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False by = by + 1 bx = bx - 1 Call show14(bx, by) next_block_kind = 14 End If End If Case 16 If by * 10 + bx + 19 < 169 And bx >= 1 Then If Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 19).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False by = by + 1 bx = bx - 1 Call show17(bx, by) next_block_kind = 17 End If Else If Form_main.Image_block(by * 10 + bx + 10).Visible = False And Form_main.Image_block(by * 10 + bx + 20).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False by = by + 1 Call show17(bx, by) next_block_kind = 17 End If End If Case 17 If by * 10 + bx + 11 < 169 Then If Form_main.Image_block(by * 10 + bx - 10).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then Form_main.Image_block(by * 10 + bx + 1).Visible = False Form_main.Image_block(by * 10 + bx + 2).Visible = False by = by - 1 Call show18(bx, by) next_block_kind = 18 End If End If Case 18 If by * 10 + bx + 21 < 169 And bx <= 7 Then If Form_main.Image_block(by * 10 + bx + 2).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False Call show6(bx, by) next_block_kind = 6 End If Else If Form_main.Image_block(by * 10 + bx + 1).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 21).Visible = False bx = bx - 1 Call show6(bx, by) next_block_kind = 6 End If End If Case 19 If by * 10 + bx + 30 < 169 And bx >= 1 And bx <= 7 Then If Form_main.Image_block(by * 10 + bx + 9).Visible = False And Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False bx = bx - 1 by = by + 1 Call show7(bx, by) next_block_kind = 7 End If ElseIf by * 10 + bx + 30 < 169 And bx < 1 Then If Form_main.Image_block(by * 10 + bx + 11).Visible = False And Form_main.Image_block(by * 10 + bx + 12).Visible = False And Form_main.Image_block(by * 10 + bx + 13).Visible = False Then Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False Form_main.Image_block(by * 10 + bx).Visible = False by = by + 1 Call show7(bx, by) next_block_kind = 7 End If ElseIf by * 10 + bx + 30 < 169 And bx = 8 Then If Form_main.Image_block(by * 10 + bx + 7).Visible = False And Form_main.Image_block(by * 10 + bx + 8).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False by = by + 1 bx = bx - 2 Call show7(bx, by) next_block_kind = 7 End If ElseIf by * 10 + bx + 30 < 169 And bx = 9 Then If Form_main.Image_block(by * 10 + bx + 7).Visible = False And Form_main.Image_block(by * 10 + bx + 8).Visible = False And Form_main.Image_block(by * 10 + bx + 9).Visible = False Then Form_main.Image_block(by * 10 + bx).Visible = False Form_main.Image_block(by * 10 + bx + 20).Visible = False Form_main.Image_block(by * 10 + bx + 30).Visible = False by = by + 1 bx = bx - 3 Call show7(bx, by) next_block_kind = 7 End If End If End Select End Sub
Option Explicit Dim block_i, block_j As Integer Dim next_i, next_j As Integer
Sub face()
Form_main.Height = 8420 '设置窗体的大小 Form_main.Width = 8000 Form_main.Picture_play_field.Left = 0 '设置容器位置 Form_main.Picture_play_field.Top = -480 Form_main.Picture_play_field.Height = 8200 '设置容器大小 Form_main.Picture_play_field.Width = 4850
End Sub Sub image_position() For block_i = 0 To 16 For block_j = 0 To 9 Form_main.Image_block(block_i * 10 + block_j).Left = block_j * 480 Form_main.Image_block(block_i * 10 + block_j).Top = block_i * 480 Form_main.Image_block(block_i * 10 + block_j).Visible = False Next Next For next_i = 0 To 3 For next_j = 0 To 3 Form_main.Image_next(next_i * 4 + next_j).Left = next_j * 480 Form_main.Image_next(next_i * 4 + next_j).Top = next_i * 480 Form_main.Image_next(next_i * 4 + next_j).Visible = False Next Next
End Sub '十七种方块

|