Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

HHHHEEEEEELLLLLP - Computer Class Dilema

We need major help...we have a computer game in VB due in 2 days. We created "CandyLand". This is our code....how do we clear their previous moves:

Dim MyColours(7) As String
Dim player As String
Dim CurrentTileH As Integer
Dim CurrentTileG As Integer


Private Sub cmdCardDeck_Click()
Dim n As Integer
Randomize
n = Int(Rnd(1) * 6)
imgCard.Visible = False
lblDeckofCards.BackColor = MyColours(n)
If player = "hansel" Then
player = "gretle"
imgGretle.BorderStyle = 1
imgHansel.BorderStyle = 0
'moving character
For x = CurrentTileH To 58
If cmdRed(x).BackColor = lblDeckofCards.BackColor Then
cmdRed(x).Picture = imgHansel.Picture
CurrentTileH = x
Exit For
End If

If CurrentTileH = x - 1 Then
Label2.Visible = False
End If

Next x
If CurrentTileH = cmdRed(10) Then
ReturnValue = MsgBox("You've Reached Gloopy Gluch", vbOKOnly, "Congratulations")
End If
If ReturnValue = 1 Then
Game.Visible = False
frmGloopy.Visible = True
End If
ElseIf player = "gretle" Then
player = "hansel"
imgHansel.BorderStyle = 1
imgGretle.BorderStyle = 0
'moving character
For x = CurrentTileG To 58
If cmdRed(x).BackColor = lblDeckofCards.BackColor Then
cmdRed(x).Picture = imgGretle.Picture
CurrentTileG = x

If CurrentTileH = cmdRed(58) Then
ReturnValue = MsgBox("You Win!", vbOKOnly, "Congratulations")
End If
Exit For
End If

Next x
If CurrentTileG = cmdRed(10) Then
ReturnValue = MsgBox("You've Reached Gloopy Gluch", vbOKOnly, "Congratulations")
End If
If ReturnValue = 1 Then
Game.Visible = False
frmGloopy.Visible = True

If CurrentTileG = cmdRed(58) Then
ReturnValue = MsgBox("You Win!", vbOKOnly, "Congratulations")
End If
End If

End If

If CurrentTileG = CurrentTileH And CurrentTileH = CurrentTileG Then
CurrentTileG = CurrentTile - 1
End If

End Sub
Private Sub cmdColour_Click(Index As Integer)
If player = "Hansel" Then
cmdColour.Item.Picture = b + b.gif
ElseIf player = "gretle" Then
cmdColour.Item.Picture = girl - Picture.gif
End Sub




Private Sub Form_Load()
player = "hansel"
Dim Colours(7) As String
MyColours(0) = "8421631"
MyColours(1) = "8438015"
MyColours(2) = "8454143"
MyColours(3) = "8454016"
MyColours(4) = "16777088"
MyColours(5) = "16744576"
MyColours(6) = "16744703"
CurrentTile = 0
End Sub


THANKS SO MUCH:D
Sign In or Register to comment.