octoPaulVB
Putamierda de programa ya está hecho, es lo del pulpo paul este de los huevos que todo el mundo está dando la tabarra ultimamente. Aquí teneis el programita.
Es más, es tan cutre que os voy a poner el código xD.
http://www.mediafire.com/?m4ehmxxmitt
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call recolocar()
End Sub
Public Sub recolocar()
Button1.Left = (Me.Width / 2) - (paul.Width / 2)
Button1.Top = 20
paul.Left = (Me.Width / 2) - (paul.Width / 2)
paul.Top = 50
t1.Left = 12
t2.Left = Me.Width - t2.Width - 17
t1.Width = paul.Width + 1
t2.Width = t1.Width
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call recolocar()
Dim i As Integer
Randomize()
i = CInt(Int((2 * Rnd()) + 1))
If i = 1 Then
While Not paul.Left = t1.Left Or Not paul.Top = t1.Top - paul.Height
If Not paul.Left = t1.Left Then
paul.Left = paul.Left - 1
End If
If Not paul.Top = t1.Top - paul.Height Then
paul.Top = paul.Top + 1
End If
End While
Else
While Not paul.Left = t2.Left Or Not paul.Top = t2.Top - paul.Height
If Not paul.Left = t2.Left Then
paul.Left = paul.Left + 1
End If
If Not paul.Top = t2.Top - paul.Height Then
paul.Top = paul.Top + 1
End If
End While
End If
End Sub
End Class