Click to See Complete Forum and Search --> : help with game
I am not a really good game programmer, actually, I kind of suck.
but I do this code
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Picture1.Move 0, 100
End If
End Sub
i have also tried keypress, this doesnt work, why?
kedaman
May 13th, 2000, 01:59 AM
I don't see anything wrong with it except if you
1. don't have a movable control named picture1
2. don't press enter key to activate it
3. have focus on another control and no keypreview for the form
thanks, I got it working using timers.
I have 4 buttons, up, down, left, right,
and 4 timers
the code is like this
.....command1_mousedown... etc...
timer1.enabled = true
timer2.enabled = false
timer3.enabled = false
timer4.enabled = false
end sub
........ command1_mouseup.... etc..
timer1.enabled = false
timer2.enabled = false
timer3.enabled = false
timer4.enabled = false
end sub
and in the timer
...... timer
thisthing = picture1.top - 100
picture1.top = thisthing
I am lazy, so I didnt type it exact.. but, while the mouse is down the timer is enabled.. and the pic keeps moving as long as the mouse is down, when you let go of the mouse, it doesnt move anymore....
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.