elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Curso de javascript por TickTack


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  juego del ping pong
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: juego del ping pong  (Leído 5,783 veces)
chaarlyyyy

Desconectado Desconectado

Mensajes: 20


Ver Perfil
juego del ping pong
« en: 9 Octubre 2009, 05:41 am »

hola necesito ayuda con este ejercicio tngo que hacer que rebote por las 4 paredes pero solo logro hacer que rebote derecho

esto es lo que he echo

Private Sub Form_KeyPress(KeyAscii As Integer)
'Print "tecla:"; Chr$(KeyAscii)
'Print "valor"; KeyAscii
If KeyAscii = 119 And Shape1.Top > 100 Then
Shape1.Top = Shape1.Top - 100
End If
If KeyAscii = 120 And Shape1.Top < 8900 Then
Shape1.Top = Shape1.Top + 100
End If
If KeyAscii = 56 And Shape2.Top > 100 Then
Shape2.Top = Shape2.Top - 100
End If
If KeyAscii = 50 And Shape2.Top < 8800 Then
Shape2.Top = Shape2.Top + 100
End If
If KeyAscii = 115 Then
Shape1.Height = Shape1.Height - 50
Shape1.Top = Shape1.Top - 25
End If
If KeyAscii = 97 Then
Shape1.Height = Shape1.Height + 50
Shape1.Top = Shape1.Top + 25
End If
If KeyAscii = 53 Then
Shape2.Height = Shape2.Height - 50
Shape2.Top = Shape2.Top - 25
End If
If KeyAscii = 48 Then
Shape2.Height = Shape2.Height + 50
Shape2.Top = Shape2.Top + 25
End If
End Sub

Private Sub Timer1_Timer()
Randomize
x = Int(Rnd(30) * 20)
If i = 0 Then
Shape3.Left = Shape3.Left + (x * 10)
Else
Shape3.Left = Shape3.Left - (x * 10)
End If
If Shape3.Left < 100 Then
i = 1
End If
If Shape3.Left > 18378 Then
i = 1
End If
If Shape3.Left - 495 <= Shape1.Left And Shape3.Top > Shape1.Top And Shape3.Top < Shape1.Top + 1815 Then
i = 0
End If
End Sub


En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: juego del ping pong
« Respuesta #1 en: 9 Octubre 2009, 08:10 am »

http://foro.elhacker.net/programacion_vb/tengo_un_problema-t269981.0.html

Tengo entendido que para eso podrias mejor usar Seno, Coseno, Tangente y Teorema de PITAGORAS para a calcular los puntos en X,Y y saber si llegas a un punto de rebote. Y si acaso lo requieres V=D/T para calcular los catetos correspondientes según la velocidad de la pelota.

Mira un video de lo que te he mencionado:



P.D.: Busca en PSC hay hay ejemplos.

Dulces Lunas!¡.


« Última modificación: 9 Octubre 2009, 09:22 am por ░▒▓BlackZeroҖ▓▒░ » En línea

The Dark Shadow is my passion.
LeandroA
Moderador
***
Desconectado Desconectado

Mensajes: 760


www.leandroascierto.com


Ver Perfil WWW
Re: juego del ping pong
« Respuesta #2 en: 9 Octubre 2009, 21:31 pm »

Aca hay un poco mas de infor para aprender sobre senos.


 ;D ;D
En línea

xkiz ™


Desconectado Desconectado

Mensajes: 1.252


Ver Perfil WWW
Re: juego del ping pong
« Respuesta #3 en: 9 Octubre 2009, 23:13 pm »

jajajajaja......
En línea

Hasseds

Desconectado Desconectado

Mensajes: 145



Ver Perfil
Re: juego del ping pong
« Respuesta #4 en: 9 Octubre 2009, 23:52 pm »

 :o
En línea

Sergio Desanti
BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: juego del ping pong
« Respuesta #5 en: 10 Octubre 2009, 05:27 am »



 :o :xD :¬¬ :-X
En línea

The Dark Shadow is my passion.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[JUEGO] Pong! XD « 1 2 »
Programación Visual Basic
79137913 18 7,934 Último mensaje 11 Febrero 2011, 12:23 pm
por 79137913
Juego de Ping-Pong hecho en C.
Programación C/C++
NeoB 7 26,366 Último mensaje 8 Julio 2012, 09:05 am
por durasno
PONG Game - Simple Juego "Pong" [VBScript + HTA] (100% Notepad)
Scripting
JohnConnor 0 5,019 Último mensaje 22 Febrero 2013, 19:07 pm
por JohnConnor
Juego del Pong en C
Programación C/C++
almer95 1 2,095 Último mensaje 2 Enero 2015, 14:36 pm
por Yoel Alejandro
Juego Pong, quisiera saber el error.
Programación C/C++
angardo 3 2,719 Último mensaje 28 Julio 2017, 23:58 pm
por ivancea96
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines