JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



Please Help


P

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam pritommojumder
Posts: 2 - Registered: 2013-06-27 08:48:33

I am a visual basic programmer since 2010. But, I am not so experts. I wanna make a game like "Little Alchemy" in VB 10. I need to know two things.
1> How to make movable button?
2> How to create a action like that "change a button by another button dropping on it" ?

Please, someone help me

You can play Little Alchemy from google app store




C

keyboard_arrow_up
1
keyboard_arrow_down


Reply #1 Mark as Spam cooll1975denisemendez
Posts: 8 - Registered: 2013-05-23 09:43:14

hello, about your first question. Please refer to the following code.
1.PUT A COMMANDBUTTON CALLED "Command1"
2. INTO THE MouseMove EVENT PUT

e = Int((4 - 1 + 1) * Rnd + 1)

If e = 1 Then
Command1.Top = Command1.Top + Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 2 Then
Command1.Left = Command1.Left + Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 3 Then
Command1.Top = Command1.Top - Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 4 Then
Command1.Left = Command1.Left - Int((20 - 10 + 1) * Rnd + 10)
End If




Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

e = Int((4 - 1 + 1) * Rnd + 1)

If e = 1 Then
Command1.Top = Command1.Top + Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 2 Then
Command1.Left = Command1.Left + Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 3 Then
Command1.Top = Command1.Top - Int((20 - 10 + 1) * Rnd + 10)
ElseIf e = 4 Then
Command1.Left = Command1.Left - Int((20 - 10 + 1) * Rnd + 10)
End If
End Sub




P

keyboard_arrow_up
0
keyboard_arrow_down


Reply #2 Mark as Spam pritommojumder
Posts: 2 - Registered: 2013-06-27 08:48:33

Thank you!!! But my second question???? Please Help or show me a way






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising