Form1.frm

 VERSION 5.00
Begin VB.Form Form1
   AutoRedraw      =   -1  'True
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   ClientHeight    =   3195
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   7440
   BeginProperty Font
      Name            =   "Garamond"
      Size            =   36
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H00FF8080&
   Icon            =   "Form1.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MouseIcon       =   "Form1.frx":030A
   MousePointer    =   99  'Custom
   ScaleHeight     =   213
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   496
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.Timer Timer6
      Interval        =   1
      Left            =   1800
      Top             =   840
   End
   Begin VB.Timer Timer5
      Enabled         =   0   'False
      Interval        =   700
      Left            =   2640
      Top             =   1440
   End
   Begin VB.Timer Timer4
      Enabled         =   0   'False
      Interval        =   700
      Left            =   2040
      Top             =   1440
   End
   Begin VB.Timer Timer3
      Enabled         =   0   'False
      Interval        =   700
      Left            =   1440
      Top             =   1440
   End
   Begin VB.Timer Timer2
      Enabled         =   0   'False
      Interval        =   700
      Left            =   840
      Top             =   1440
   End
   Begin VB.PictureBox Picture1
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      Enabled         =   0   'False
      BeginProperty Font
         Name            =   "Garamond"
         Size            =   72
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1335
      Left            =   7080
      ScaleHeight     =   89
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   273
      TabIndex        =   0
      Top             =   -120
      Width           =   4095
      Begin VB.Label Label1
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "SCORE - 0"
         BeginProperty Font
            Name            =   "Impact"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FF00&
         Height          =   285
         Left            =   0
         TabIndex        =   1
         Top             =   360
         Width           =   840
      End
   End
   Begin VB.Image Image1
      Height          =   480
      Left            =   600
      Picture         =   "Form1.frx":03D4
      Top             =   600
      Width           =   480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Program written by Alexander Anikin
' E-Mail: pegas@poshuk.com
Option Explicit
Dim f As Integer, j As Integer, p As Integer
Dim a As Long
Dim OldHeight As Long, OldWidth As Long, OldDepth As Long
Dim X1 As Integer, Y1 As Integer
Dim X2 As Integer, Y2 As Integer
Dim MyColor As Byte
Dim Score As Integer

Private Declare Function SetWindowPos Lib "user32" ( _
ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const HWND_TOPMOST = -1

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub TrueOnTop(myForm As Object)
        SetWindowPos myForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Unload Me
End Sub

Private Sub Form_Load()
If App.PrevInstance = True Then End
Select Case UCase$(Left$(Command$, 2))
Case "/P"
Unload Me
Exit Sub
Case "/C"
Unload Me
Exit Sub
Case "/A"
Unload Me
Exit Sub
Case "/S"
Show
   Case Else
Unload Me
Exit Sub
End Select
''''''''''''''''''''
Dim Height As Long, Width As Long, Depth As Long
GetVideoMode Width, Height, Depth
OldHeight = Height
OldWidth = Width
OldDepth = Depth
SetVideoMode 640, 480, 24
'''''''''''''

TrueOnTop Form1
Font.Name = "Garamond"
Draw_Board
End Sub

Private Sub Click_Click(x As Single, y As Single)
If Point(x, y) = RGB(1, 1, 1) Then
If Image1.Top < 90 Then Image1.Top = Rnd * 100 + 200
Image1.Left = 470 + Rnd * 32
Timer6.Interval = 500
Exit Sub
End If
X1 = 20
Y1 = 20
For j = 0 To 21
For p = 0 To 21
up:
a = QBColor(Rnd * 14 + 1)
If a = Point(x, y) Then GoTo up
If x < X1 + 20 And x > X1 And y < Y1 + 20 And y > Y1 Then
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), a, BF

Image1.Left = X1 + 9
Image1.Top = Y1 + 9

BeginPlaySound 7
If Point(Image1.Left + 20, Image1.Top) = a Then
Timer2.Enabled = True
End If
If Point(Image1.Left - 20, Image1.Top) = a Then
Timer3.Enabled = True
End If
If Point(Image1.Left, Image1.Top + 20) = a Then
Timer4.Enabled = True
End If
If Point(Image1.Left, Image1.Top - 20) = a Then
Timer5.Enabled = True
End If
Exit Sub
End If
X1 = X1 + 20
If X1 = 460 Then
X1 = 20
Y1 = Y1 + 20
End If
Next p
Next j


End Sub


Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Unload Me
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    Static X0 As Integer, Y0 As Integer
'-----------------------------------------------------------------
        If x = Screen.Width \ 15 - 1 Or y = Screen.Height \ 15 - 1 _
        Or ((X0 = 0) And (Y0 = 0)) Or _
           ((Abs(X0 - x) < 5) And (Abs(Y0 - y) < 5)) Then ' small mouse movement...
            X0 = x                          ' Save current x coordinate
            Y0 = y                          ' Save current y coordinate
            Exit Sub                        ' Exit
        End If
   
        Unload Me                           ' Large mouse movement (terminate screensaver)

End Sub

Private Sub Form_Unload(Cancel As Integer)
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = False
Timer5.Enabled = False
Timer6.Enabled = False
Cls
Picture1.Visible = False
Image1.Visible = False
ForeColor = vbRed
CurrentY = 180
CurrentX = (Screen.Width \ 15 - TextWidth("GAME OVER")) \ 2
Print "GAME OVER"
CurrentX = (Screen.Width \ 15 - TextWidth("© PapAKArlo-2000")) \ 2

ForeColor = vbGreen
Print "© PapAKArlo-2000"
DoEvents
Sleep 1500
EndPlaySound
SetVideoMode OldWidth, OldHeight, OldDepth
End
End Sub


Private Sub Timer2_Timer()
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), BackColor, BF
Line (X1 + 21, Y1 + 1)-(X1 + 39, Y1 + 19), BackColor, BF
EndPlaySound
BeginPlaySound 5
Score = Score + 10
If Score > 10000 Then
Score = 0
Draw_Board
End If
Label1.Caption = "SCORE - " & Score
Timer2.Enabled = False
End Sub

Private Sub Timer3_Timer()
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), BackColor, BF
Line (X1 - 21, Y1 + 1)-(X1 - 1, Y1 + 19), BackColor, BF
EndPlaySound
BeginPlaySound 5
Score = Score + 10
If Score > 10000 Then
Score = 0
Draw_Board
End If
Label1.Caption = "SCORE - " & Score
Timer3.Enabled = False
End Sub

Private Sub Timer4_Timer()
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), BackColor, BF
Line (X1 + 1, Y1 + 21)-(X1 + 19, Y1 + 39), BackColor, BF
EndPlaySound
BeginPlaySound 5
Score = Score + 10
If Score > 10000 Then
Score = 0
Draw_Board
End If
Label1.Caption = "SCORE - " & Score
Timer4.Enabled = False
End Sub

Private Sub Timer5_Timer()
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), BackColor, BF
Line (X1 + 1, Y1 - 21)-(X1 + 19, Y1 - 1), BackColor, BF
EndPlaySound
BeginPlaySound 5
Score = Score + 10
If Score > 10000 Then
Score = 0
Draw_Board
End If
Label1.Caption = "SCORE - " & Score
Timer5.Enabled = False
End Sub

Private Sub Timer6_Timer()
Timer6.Interval = 1501
Click_Click Rnd * 440 + 20, Rnd * 440 + 20
End Sub

Private Sub Draw_Board()
For f = 20 To 460 Step 20
Line (20, f)-(460, f), RGB(1, 1, 1)
Next f
For f = 20 To 460 Step 20
Line (f, 20)-(f, 461), RGB(1, 1, 1)
Next f

Randomize
MyColor = Rnd * 14

X1 = 20
Y1 = 20
For j = 0 To 21
For p = 0 To 21
MyColor = MyColor + 1: If MyColor = 16 Then MyColor = 1
Line (X1 + 1, Y1 + 1)-(X1 + 19, Y1 + 19), QBColor(MyColor), BF

X1 = X1 + 20
If X1 = 460 Then
X1 = 20
Y1 = Y1 + 20
End If
Next p
Next j
End Sub

Project Homepage: