il couvre toute la largeur du programme
impossiblité de perdre..
mon programme fait 613 de large. Et 742 de hauteur.
Public Class Form1 Dim moveright As Boolean Dim moveup As Boolean Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'mouvement balle If moveright = True Then balle.Left += 5 Else balle.Left -= 5 End If If moveup = True Then balle.Top += 5 Else balle.Top -= 5 End If 'colisions If balle.Left <= Me.ClientRectangle.Left Then moveright = True End If If balle.Right >= Me.ClientRectangle.Right Then moveright = False End If If balle.Top <= Me.ClientRectangle.Top Then moveup = True End If 'probleme impossiblité de perde If balle.Bottom >= mur.Top Then moveup = False End If 'deplacement mur sur X grace a la souris mur.Left = MousePosition.X End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf balle.Bottom >= mur.Top Then moveup = False End If
if balle.bounds.intersectwith(mur.bounds) then moveup = true end if