my code is this:
Public x As Integer
Public y As Integer
Public ax As Integer
Public ay As Integer
Public xpie(3) As Integer
Public ypie(3) As Integer
'funciones
Function selectxy(x, y)
selectxy = Cells(y, x)
End Function
'metodos
Sub inOpen()
With Range("a1", "t20")
.Interior.Color = RGB(255, 255, 255)
.RowHeight = 13
.ColumnWidth = 2
End With
For Each xp In xpie
xp = Rnd(100)
Next xp
Debug.Print ("empieza")
'teclas
Application.OnKey "{RIGHT}", "right"
Application.OnKey "{LEFT}", "left"
'inisialisacion
x = 1
y = 20
Cells(y, x).Interior.Color = RGB(0, 0, 255)
End Sub
Sub right()
If x <> 20 Then
ax = x
x = x + 1
Cells(y, x).Interior.Color = RGB(0, 0, 255)
Cells(y, ax).Interior.Color = RGB(255, 255, 255)
End If
End Sub
Sub left()
If x <> 1 Then
ax = x
x = x - 1
Cells(y, x).Interior.Color = RGB(0, 0, 255)
Cells(y, ax).Interior.Color = RGB(255, 255, 255)
End If
End Sub
Sub game()
Do
DoEvents
Cells(y, x).Interior.Color = RGB(0, 0, 100)
DoEvents
Loop While True
End Sub