Ping pong time 2

Description

Un Filtre en plus par rapport au 1
Maj Depassement

Source / Exemple :


Public texte As String
Public PosX As Integer
Public PosY As Integer
Public PosV As Boolean
Public PosH As Boolean
Private Sub Form_Activate()
Timer1.Enabled = True
End Sub
Private Sub Form_DblClick()
End
End Sub
Private Sub Form_Load()
Timer1.Interval = 1
Form1.ScaleMode = 2
'Form1.BorderStyle = 5
PosV = True
PosH = True
PosX = 0
PosY = 0
LineH.X1 = 0
LineH.X2 = Form1.ScaleWidth
LineH.Y1 = Form1.ScaleHeight
LineH.Y2 = Form1.ScaleHeight
LineV.X1 = Form1.ScaleWidth
LineV.X2 = Form1.ScaleWidth
LineV.Y1 = 0
LineV.Y2 = Form1.ScaleHeight
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
LineV.X1 = X
LineV.X2 = X
LineV.Y2 = Form1.ScaleHeight
LineH.X2 = Form1.ScaleWidth
LineH.Y1 = Y
LineH.Y2 = Y
End Sub
Private Sub Timer1_Timer()
Cls
'On peut l'adapter pour afficher autre chose
texte = Time
If PosY > LineH.Y1 - 8 Then
PosY = LineH.Y1 - 9
PosV = False
End If
If PosX > LineV.X1 - 31 Then
PosX = LineV.X1 - 32
PosH = False
End If
If PosX < 0 Then PosH = True
If PosY < 0 Then PosV = True
If PosH Then PosX = PosX + 1 Else PosX = PosX - 1
If PosV Then PosY = PosY + 1 Else PosY = PosY - 1
Form1.CurrentX = PosX
Form1.CurrentY = PosY
Print texte
End Sub

Conclusion :


Si quelq'un connait un technique pour eviter le scintillement, je suis preneur
A+ ;-)#

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.