Y me despido dejando una captura de pantalla:
PD: Dejo el código que yo hice para el juego, por si alguien tiene curiosidad o quiere experimentar sencillamente.
Dim x As Integer
Dim y As Integer
'Código hecho por Javier Valor.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 83 Then
Timer2.Enabled = True
End If
If KeyCode = 87 Then
Timer3.Enabled = True
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 83 Then
Timer2.Enabled = False
End If
If KeyCode = 87 Then
Timer3.Enabled = False
End Ifv End Sub
Private Sub Form_Load()
x = 40
y = 40
Timer1.Enabled = True
Timer1.Interval = 20
Timer2.Interval = 20
Timer2.Enabled = False
Timer3.Interval = 20
Timer3.Enabled = False
Shape2.BackStyle = 1
Shape2.BackColor = vbBlue
Shape1.BackColor = vbYellow
Shape1.BackStyle = 1
Caption = "Portón"
BackColor = RGB(14, 241, 67)
End Sub
Private Sub Timer1_Timer()
Shape1.Left = Shape1.Left - x
Shape1.Top = Shape1.Top + y
If Shape1.Left = 600 Then
x = -40
Label1.Caption = Val(Label1.Caption) + 1
End If
If Shape1.Top = 4800 Then
y = -40
End If
If Shape1.Top = 0 Then
y = 40
End If
If Shape1.Left = 7800 Then
x = 40
Label4.Caption = Val(Label4.Caption) + 1
If Label4.Caption = 5 Then
Form2.Show
Unload Me
End If
End If
If ((Shape2.Top + Shape2.Height) >= Shape1.Top) And (Shape2.Top <= (Shape1.Top + Shape1.Height)) Then
If (Shape2.Left - 120 >= Shape1.Left) And ((Shape2.Left - 120 + Shape2.Width) <= (Shape1.Left + Shape1.Width)) Then
x = 40
Beep
End If
End If
End Sub
Private Sub Timer2_Timer()
If Shape2.Top <= 4440 Then
Shape2.Top = Shape2.Top + 30
End If
End Sub
Private Sub Timer3_Timer()
If Shape2.Top >= 120 Then
Shape2.Top = Shape2.Top - 30
End If
End Sub
'Código hecho por Javier Valor.
No hay comentarios:
Publicar un comentario