Underc0de

Programación General => Visual Basic => Códigos Fuentes => Topic started by: 79137913 on February 07, 2013, 09:18:02 am

Title: [CrapCode] Codigo que tira rayos por los ojos.
Post by: 79137913 on February 07, 2013, 09:18:02 am
HOLA!!!

Estaba aburrido, y como nadie contesta el reto hice esto:
Code: (vb) You are not allowed to view links. Register or Login
    'armen un form con:
    ' 2 shapes
    ' 2 lines
    ' 1 timer
    ' y denle a f5
     
    Private Sub Form_Load()
       Me.ScaleMode = vbPixels
       Me.ScaleHeight = 600
       Me.ScaleWidth = 800
       Shape1.Top = Me.ScaleHeight / 2 - 200
       Shape2.Top = Me.ScaleHeight / 2 - 200
       Shape1.Left = Me.ScaleWidth / 2 - 150
       Shape2.Left = Me.ScaleWidth / 2 + 150
       Shape1.Shape = 2
       Shape2.Shape = 2
       Shape1.Width = 150
       Shape2.Width = 150
       Shape1.Height = 300
       Shape2.Height = 300
       Line1.BorderColor = &HFF&
       Line2.BorderColor = &HFF&
       Line1.X1 = Shape1.Left + Shape1.Width / 2
       Line1.Y1 = Shape1.Top + Shape1.Height / 2
       Line2.X1 = Shape2.Left + Shape2.Width / 2
       Line2.Y1 = Shape2.Top + Shape2.Height / 2
       Timer1.Interval = 100
    End Sub
     
    Private Sub Timer1_Timer()
       Randomize
       neg = 1
       If Rnd() * 2 > 1 Then neg = -1
       Line1.X2 = Shape1.Left + Shape1.Width / 2 + Rnd() * 300 * neg
       neg = 1
       If Rnd() * 2 > 1 Then neg = -1
       Line1.Y2 = Shape1.Top + Shape1.Height / 2 + Rnd() * 300 * neg
       neg = 1
       If Rnd() * 2 > 1 Then neg = -1
       Line2.X2 = Shape2.Left + Shape2.Width / 2 + Rnd() * 300 * neg
       neg = 1
       If Rnd() * 2 > 1 Then neg = -1
       Line2.Y2 = Shape2.Top + Shape2.Height / 2 + Rnd() * 300 * neg
    End Sub
     

GRACIAS POR LEER!!!