Mosquito en visual basic

Páginas: 3 (550 palabras) Publicado: 10 de noviembre de 2011
ption Explicit
Dim entorno(1 To 24, 1 To 34) As Integer 'Matriz de entorno.
Dim postop(1 To 24) As Integer
Dim posleft(1 To 34) As Integer
Dim tiempo As Variant
Dim vida As Integer
Dim filini,colini As Integer 'Fila y columna inicial ingresadas.
Dim fil, col As Integer 'Variables para saber en que fila y columna esta el móvil.
Private Sub ambiente_DragDrop(Source As Control, x As Single,Y As Single)
Dim file, cole As Integer 'Fila y columna del obstáculo en el entorno.
'Alinear con la cuadricula.
Source.Left = Int(((Int(x / 240) + 1) * 240) + 10) - 120
Source.Top =Int(((Int(Y / 240) + 1) * 240) + 10) - 120

file = Int(Y / 240) 'Obtener fila del obstáculo ubicado.
cole = Int(x / 240) 'Obtener columna del obstáculo ubicado.

If Source.Name= "obst" Then
entorno(file, cole) = 1 'Indicador de obstáculo en el entorno.
End If

Source.Visible = True
Source.Enabled = True
Source.Drag vbEndDragSource.ZOrder
End Sub
Private Sub autor_Click()
MsgBox ("Autor: Leandro Cantore")
End Sub
Private Sub Combo1_Click()
mosq.Top = (Combo1.ListIndex * 240) + 250
fil = Int(mosq.Top / 240) - 1Label7.Refresh
Label7.Caption = Str(fil)
End Sub
Private Sub Combo2_Click()
mosq.Left = (Combo2.ListIndex * 240) + 250
col = Int(mosq.Left / 240) - 1
Label9.RefreshLabel9.Caption = Str(col)
End Sub
Private Sub comenzar_Click()
Dim direccion As Integer
Dim mensaje
ambiente.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = Falsevalorenerg.Enabled = False 'Deshabilita la Scrollbar.
Randomize
Label1.ForeColor = &H0&
comenzar.Enabled = False
restart.Enabled = False
Do 'Ciclo de movimiento.
direccion =Int((Rnd * 8) + 1)
Select Case direccion
Case Is = 1
If fil > 1 Then 'Verificar no salir del entorno.
If entorno(fil - 1, col) = 0 Then 'Verificar que...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Visual Basic
  • Visual basic
  • visual basic
  • Visual Basic
  • visual basic
  • visual basic
  • visual basic
  • Visual basic

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS