Hi,
I am having two issues with making my Maze Game in VB.NET. I want the levels to be difficult to solve so I am making some *sliding* (NOT MOVING) Panels to interrupt the players.
These are my problems:
1. I want the Panel to slide (Sliding Up and then Down, then Up and Down, then Up...) forever, but it doesn't. It will only slide the times I have written the code.
2. I want the MouseEnter event to work when the mouse touches the Panel during the Panel is sliding.
3. Is it right to use a Timer?
Here are some details and the codes which I have used:
I have first made an Integer = 6 for the speed of sliding.
The timer is not enabled and started. It will be started and enabled when Button1 is clicked.
Timer's interval: 100
Panel's name: Panel1
Timer's name: Timer1
When the user clicks Button1, Timer1 starts, which will slide Panel1. (My code is for moving the panel. I need to slide the panel. IT'S WRONG!)
Timer1's code:
Dim BlockY As Integer = 6
If Me.LineShape1.Location = New Point(82, 31) Then
Do Until Me.LineShape1.Location = New Point(82, 307)
Me.LineShape1.Top = Me.LineShape1.Top + BlockY
Loop
End If
If Me.LineShape1.Location = New Point(82, 307) Then
Do Until Me.LineShape1.Location = New Point(82, 31)
Me.LineShape1.Top = Me.LineShape1.Top - BlockY
Loop
End If
Any help will be appreciated! For further details, please reply.
Thanks!