uhm. im new to visual basic 6. im making a maze program, ones like those that pop up a scary picture or something. im having a bit of a trouble with calling a sub thing.im not really sure if thats what you call it.
program runs this way, as i run it, theres a start button that triggers a timer for the game. the paths for the mouse move, i used labels. if the mouse runs off a label and hits the exact form, the game will end or the player looses. but my problem is that i want to trigger the mousemove event right after i have clicked the start button that my game wont say game over right after i run it.

response would be really much appreciated.

i have this already :

Private Sub Command1_Click()
Label10.Visible = True -------------->> after this form_mousemove must perform.
End Sub


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As  Single)------------------------->> this shouldn't perform upon running. it will only    perform after command1_click() 
MsgBox " GAME OVER!"
End Sub

Recommended Answers

All 3 Replies

Simplest way is just to test for Label10.Visible = True inside the Form_MouseMove event, like this:

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label10.Visible = True Then
    MsgBox "Game Over!"
End If
End Sub

However, that means that unless your button is overlapping your label, there's no way to get the mouse from your button to your Label without triggering the Form_MouseMove event.

Not knowing anything about your game, or how the controls work in it, I hesitate to offer any specific advice. You may want to look at the Game Development forum here for some ideas. Good luck!

Simplest way is just to test for Label10.Visible = True inside the Form_MouseMove event, like this:

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label10.Visible = True Then
    MsgBox "Game Over!"
End If
End Sub

However, that means that unless your button is overlapping your label, there's no way to get the mouse from your button to your Label without triggering the Form_MouseMove event.

Not knowing anything about your game, or how the controls work in it, I hesitate to offer any specific advice. You may want to look at the Game Development forum here for some ideas. Good luck!

thanks for the response! worked perfectly! :)))) cheers! by any chance sir do you know how to implement GIF's in vb 6?

Depends on what you mean by "implement", but yes. However, since it's a completely new subject you should start a new thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.