Drag and Drop Game in Visual Basic 6

Download
Download is available until [expire_date]
  • Version
  • Download 273
  • File Size 307.08 KB
  • File Count 1
  • Create Date April 27, 2016
  • Last Updated April 27, 2016

Drag and Drop Game in Visual Basic 6

Drag and Drop Game in Visual Basic 6

This is a two in one project; a drag and drop demo and at the same time it is a simple game developed in visual basic 6.

Program features:

Drag and drop the pictures to their corresponding boxes. One point is given if you have placed the picture to its corresponding box and one point also is given if you placed it on the wrong box. The game will end after you have placed all the pictures on the correct boxes. You can also save your score and the game has a leaderboard that shows the list of scores.

Source code:

Private Sub Imagedrop_DragDrop(Index As Integer, Source As Control, x As Single, Y As Single)
   
   If TypeOf Source Is Image Then
        Imagedrop(Index).Picture = Source.Picture
    End If
    
  If Imagedrop(Index) = Imageanimal(Index) Then
  
  MsgBox "correct", vbInformation, ""

  lblCheck.Caption = lblCheck.Caption + 1
  Imageanimal(Index).Visible = False
  Imagedrop(Index).Enabled = False
  
  Else
  MsgBox "incorrect", vbCritical, ""
  
  lblWrong.Caption = lblWrong.Caption + 1
  
  Imagedrop(Index).Picture = LoadPicture(App.Path & "lank.jpg")
  End If
    
End Sub
, , , , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.