lunes, 4 de marzo de 2013

"El portón" Juego revolucionario. ;)

Finalmente puedo inaugurar el espacio de descargas donde colgaré algunos de mis programas hechos por mí. Me gustaría que el examinador del blog los probase o les echara un vistazo al menos, ya que han sido unas horas un poco duras programando aunque no es un juego fuera de lo normal, pero lleva su tiempo. Sin más dilación dejo aquí el enlace a la descarga: Haz click aquí para descargar. Puede que se me hayan olvidado algunos detalles en el juego, pero es una versión de prueba así que sacaré con el tiempo una mejorada y definitiva. Sus controles son: W "pala" hacia arriba, S "pala" hacia abajo. No hay reglas, sencillamente hay que intentar golpear la pelota el mayor número de veces y que la pelota no rebote en la pared de atrás. Si esta lo hace más de 5 veces perderemos. En fin, esto es todo, si algo fuera mal o lo que sea, solamente comenten.
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