Hola quería pedir ayuda por que he tenido problemas para realizar un juego de conecta 4 en gambas .Este es el código de mi formulario start que es donde se lleva acabo toda la operación lógica del juego , quiero saber como guardar las fichas en cada turno hacer que no se pueda volver a tirar en ese lugar, se que tengo que igualar el array del tablero a 0 y si se ocupa un lugar igualarlo a 1 y/o -1 pero no se como plantearlo en mi programa si me pudieras ayudar te lo agradecería infinitamente aqui te dejo mi código completo , mi tablero esta hecho con 42 picture box y es un tablero de 6x7, para tirar cada ficha es necesario hacer un drag a la columna deseada y hacer click en el jugador en el turno que corresponda
graciaaaaas, espero puedan ayudarme
attentamente
Aranza Marquez
' gambas class file
tab[6, 7] As Byte
tablero[6, 7] As Object
a[5] As Byte
turno As Byte
Public Sub Form_Open()
Dim x As Byte
Dim y As Byte
Button2.Enabled = False
p44.Enabled = False
tablero[0, 0] = p1
tablero[1, 0] = p8
tablero[2, 0] = p9
tablero[3, 0] = p10
tablero[4, 0] = p11
tablero[5, 0] = p14
tablero[0, 1] = p2
tablero[0, 2] = p3
tablero[0, 3] = p4
tablero[0, 4] = p5
tablero[0, 5] = p6
tablero[0, 6] = p7
tablero[1, 1] = p12
tablero[2, 1] = p13
tablero[3, 1] = p15
tablero[4, 1] = p16
tablero[5, 1] = p37
tablero[1, 2] = p17
tablero[2, 2] = p22
tablero[3, 2] = p27
tablero[4, 2] = p32
tablero[5, 2] = p38
tablero[1, 3] = p18
tablero[2, 3] = p23
tablero[3, 3] = p28
tablero[4, 3] = p33
tablero[5, 3] = p39
tablero[1, 4] = p19
tablero[2, 4] = p24
tablero[3, 4] = p29
tablero[4, 4] = p34
tablero[5, 4] = p40
tablero[1, 5] = p20
tablero[2, 5] = p25
tablero[3, 5] = p30
tablero[4, 5] = p35
tablero[5, 5] = p41
tablero[1, 6] = p21
tablero[2, 6] = p26
tablero[3, 6] = p31
tablero[4, 6] = p36
tablero[5, 6] = p42
p45.drop = True
p43.tag = "ficha1.png"
p43.picture = Picture["ficha1.png"]
p44.tag = "ficha2.png"
p44.picture = Picture["ficha2.png"]
For x = 0 To 5
For y = 0 To 6
tab[x, y] = 0
Next
Next
End
Public Sub p43_MouseDrag()
Drag.icon = Last.picture
p43.Drag(p43.tag)
End
Public Sub p44_MouseDrag()
Drag.icon = Last.picture
p44.Drag(p44.tag)
End
Public Sub p45_Drop()
Dim x As Byte
Dim y As Byte
p45.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 0].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 0].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p46_Drop()
Dim x As Byte
p46.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 1].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 1].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p47_Drop()
Dim x As Byte
p47.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 2].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 2].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p48_Drop()
Dim x As Byte
p48.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 3].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 3].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p49_Drop()
Dim x As Byte
p49.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 4].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 4].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p50_Drop()
Dim x As Byte
Dim y As Byte
Dim t As Float
p50.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 5].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 5].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub p51_Drop()
Dim x As Byte
p51.Picture = Picture[Drag.Data]
For x = 0 To 5
tablero[x, 6].Picture = Picture[Drag.Data]
If x <> 0 Then
tablero[x - 1, 1].picture = Picture["tablero.png"]
End If
Wait 0.5
Next
End
Public Sub Button3_Click()
Form2.Close()
Message.Info("Gracias por Jugar")
End
Public Sub Button1_Click()
Button1.Enabled = False
Button2.Enabled = True
p43.Enabled = True
p44.Enabled = False
End
Public Sub Button2_Click()
Button1.Enabled = True
Button2.Enabled = False
p43.Enabled = False
p44.Enabled = True
End
Public Sub Button4_Click()
Form2.Hide()
FMain.Show()
End