Results 1 to 3 of 3

Thread: help with game

  1. #1
    Guest
    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?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  3. #3
    Guest
    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
  •  



Click Here to Expand Forum to Full Width