Dim sgnx As String
Dim sgny As String
Dim posx As Single
Dim posy As Single
Dim velox As Single
Dim mx As Long
Dim my As Long
Dim score As Integer
Dim allenamento As Boolean
Sub espandiform()
If espandi.Caption = "+" Then
If tim.Enabled = True Then
Call pausa
If Me.Height = 7320 Then
velocita.Visible = True
Me.Height = 8130
espandi.Caption = "-"
Else
velocita.Visible = False
Me.Height = 7320
espandi.Caption = "+"
End If
Else
If Me.Height = 7320 Then
Me.Height = 8130
velocita.Visible = True
espandi.Caption = "-"
Else
velocita.Visible = False
Me.Height = 7320
espandi.Caption = "+"
End If
End If
Else
Call pausa
If Me.Height = 7320 Then
velocita.Visible = True
Me.Height = 8130
espandi.Caption = "-"
Else
velocita.Visible = False
Me.Height = 7320
espandi.Caption = "+"
End If
End If
End Sub
Sub training()
velocita.Visible = False
Me.Cls
velocita.Value = 10
velox = 10
velocita.Visible = True
ball.Left = 5880
ball.Top = 3000
lblpausa.Visible = False
allenamento = True
logo.Visible = False
tim.Enabled = True
Timx.Enabled = False
Me.Height = 7320
score = 0
End Sub
Sub gohome()
Me.Cls
velocita.Value = 10
velox = 10
velocita.Visible = False
tim.Enabled = False
Timx.Enabled = False
logo.Visible = True
lblpausa.Visible = True
ball.Left = 5880
ball.Top = 3000
Me.Height = 7320
score = 0
End Sub
Sub newgame()
Me.Cls
velocita.Value = 10
velox = 10
ball.Left = 5880
ball.Top = 3000
tim.Enabled = True
lblpausa.Visible = False
logo.Visible = False
allenamento = False
Timx.Enabled = True
Me.Height = 7320
score = 0
End Sub
Sub fine()
Timx.Enabled = False
tim.Enabled = False
MsgBox "Hai perso! - Punteggio finale: " & score, vbOKOnly, score & " punti"
Call gohome
End Sub
Sub pausa()
If tim.Enabled = True Then
Timx.Enabled = False
tim.Enabled = False
lblpausa.Visible = True
Else
If allenamento = False Then
Timx.Enabled = True
Else
End If
tim.Enabled = True
lblpausa.Visible = False
End If
End Sub
Private Sub espandi_Click()
Call espandiform
End Sub
Private Sub Form_Load()
sgnx = "-"
sgny = "-"
tim.Enabled = False
lblpausa.Visible = True
allenamento = False
Timx.Enabled = False
velox = 10
Me.Height = 7320
score = 0
velocita.Value = 10
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Bs As Boolean
If Button Mod 2 = 1 Then Bs = True
If Bs = True Then
If tim.Enabled = True Then
Me.Line (mx, my)-(X, Y)
Else
End If
End If
mx = X
my = Y
End Sub
Private Sub mnallenamento_Click()
Call training
End Sub
Private Sub mnhome_Click()
Call gohome
End Sub
Private Sub mninfo_Click()
MsgBox "Creato da Ruggy94, membro di pierotofy.it", vbInformation, "PictureBall"
End Sub
Private Sub mnnewgame_Click()
Call newgame
End Sub
Private Sub mnpicturecls_Click()
Me.Cls
End Sub
Private Sub tim_Timer()
posx = ball.Left
posy = ball.Top
If posy <= 0 Then
If allenamento = True Then
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Else
Call fine
End If
End If
If posy >= 6360 Then
If allenamento = True Then
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Else
Call fine
End If
End If
If posx <= 0 Then
If allenamento = True Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
Else
Call fine
End If
End If
If posx >= 8880 Then
If allenamento = True Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
Else
Call fine
End If
End If
If Me.Point(posx, posy) = &H80FF& And Me.Point(posx + 180, posy) <> &H80FF& And Me.Point(posx, posy + 180) <> &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx + 360, posy) = &H80FF& And Me.Point(posx + 360, posy + 180) <> &H80FF& And Me.Point(posx + 180, posy) <> &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx + 360, posy + 360) = &H80FF& And Me.Point(posx + 180, posy + 360) <> &H80FF& And Me.Point(posx + 360, posy + 180) <> &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx, posy + 360) = &H80FF& And Me.Point(posx, posy + 180) <> &H80FF& And Me.Point(posx + 180, posy + 360) <> &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx + 180, posy) = &H80FF& Then
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx + 360, posy + 180) = &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
Form1.Cls
ElseIf Me.Point(posx + 180, posy + 360) = &H80FF& Then
If sgny = "-" Then
sgny = "+"
Else
sgny = "-"
End If
Form1.Cls
ElseIf Me.Point(posx, posy + 180) = &H80FF& Then
If sgnx = "-" Then
sgnx = "+"
Else
sgnx = "-"
End If
Form1.Cls
End If
If sgnx = "-" Then
ball.Left = ball.Left - velox
ElseIf sgnx = "+" Then
ball.Left = ball.Left + velox
End If
If sgny = "-" Then
ball.Top = ball.Top - velox
ElseIf sgny = "+" Then
ball.Top = ball.Top + velox
End If
End Sub
Private Sub tim2_Timer()
orario.Caption = Time
If allenamento = True Then
velox = velocita.Value
Else
End If
End Sub
Private Sub Timx_Timer()
score = score + 1
velox = velox + 1
lblpunti.Caption = score
End Sub