Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/03/2005, 10:10
galber
 
Fecha de Ingreso: agosto-2004
Mensajes: 14
Antigüedad: 20 años, 8 meses
Puntos: 0
Mover objeto con el teclado

Wenas!!

Estoy haciendo el pacman con el visual basic, y tengo un problema al mover el pacman, ya que por ahora solo puedo acerlo con numeros, pero me gustaria poder hacerlo con las teclas de direccion -->, <--, etc.

Por el momento hago esto para moverlo:
Public Sub picpac_KeyPress(KeyAscii As Integer)

If KeyAscii = 56 Then
tmrtimer.Enabled = False
Call moure
k = 0
End If
If KeyAscii = 54 Then
tmrtimer.Enabled = False
Call moure
k = 1
End If
If KeyAscii = 50 Then
tmrtimer.Enabled = False
Call moure
k = 2
End If
If KeyAscii = 52 Then
tmrtimer.Enabled = False
Call moure
k = 3
End If

End Sub

Private Sub tmrtimer_Timer()
Select Case k

Case 0:
picpac.Top = (picpac.Top - 30)
Case 1:
picpac.Left = (picpac.Left + 30)
Case 2:
picpac.Top = (picpac.Top + 30)
Case 3:
picpac.Left = (picpac.Left - 30)


End Select
End Sub

Gracias!!