|
-
May 12th, 2000, 11:35 PM
#1
I am not a really good game programmer, actually, I kind of suck.
but I do this code
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?
-
May 13th, 2000, 01:59 AM
#2
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 13th, 2000, 05:58 AM
#3
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....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|