Results 1 to 13 of 13

Thread: [resolved]Moving with the mouse

  1. #1

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86

    Question [resolved]Moving with the mouse

    Im makin a new game and i need a code for moving a little picture of a person around on a map by clickin on the new location.

    any ideas?
    Last edited by SmashX; Nov 21st, 2002 at 11:46 AM.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    You might want to be a little more specific. Here's some info that might be helpful:

    How are you doing the drawing?
    Do you plan on using animation?
    Are we talking moving in a straight line or pathfinding?

    There is no easy answer to your question without additional info. We could waste our time giving you general info, but it wouldn't be very helpful.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Look at this post. Is this what you mean...

    http://www.vbforums.com/showthread.p...hreadid=211059

  4. #4

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86
    er...i dono...

    ok.

    I have a map.
    i have a char. pic and i want a code so that where i click with my mouse the picrure will move. then ill have events like battles occure.

  5. #5

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86
    or wait...I just had a thought...
    is there a code for useing the arrow keys? when i push a arrow key the picture goes that direction.

    any ideas?

  6. #6
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Use your thought
    Get the keystrokes of the arrows,
    on left move to picture(or whatver) left, on right move .....
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  7. #7
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Put that in your "loop" and fill in the code for the movement
    VB Code:
    1. If (GetAsyncKeyState(vbKeyLeft)) Then
    2.                     'move left
    3.                 ElseIf (GetAsyncKeyState(vbKeyRight)) Then
    4.                     'move right
    5.                 End If
    6.                 If (GetAsyncKeyState(vbKeyUp)) Then
    7.                     'move up
    8.                  ElseIf (GetAsyncKeyState(vbKeyDown))  Then
    9.                     'move down
    10.                 End If
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Or try this for a start...hope you don't got a fast CPU.....
    Attached Files Attached Files

  9. #9

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86
    ill look at it fist thing in the morning.
    thanks alot.

    wanna know somthin really lame?
    im just learning what a loop is.....
    *feels degreated*

  10. #10
    Junior Member MHD's Avatar
    Join Date
    Nov 2002
    Location
    The Magical World of the Internet
    Posts
    22
    Dont feel bad. 3/4 of the time i look at some of this code and say "HUH??"
    Vowing to help the helpless, befriend the friendless, and to defeat the... um...defeatless!!

  11. #11

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86
    Originally posted by NoteMe
    Or try this for a start...hope you don't got a fast CPU.....
    ya!
    thats kinda like what i want. except he moves to fast and rapid. i would only want him to move a small distance. or move slower.

    like:

    uparrow: up 1 space
    downarrow: down 1 space
    rightarrow:right 1 space
    leftarrow:left one space

    i would have to set the distance each space is.


    [on a side note]
    could someone please explain to me (like you would teach a monkey) loops? im sitting in class and the teacher is reading a book out loud... that makes me sick...THE TEACHER DONT KNOW!
    Last edited by SmashX; Nov 20th, 2002 at 12:04 PM.

  12. #12

    Thread Starter
    Lively Member SmashX's Avatar
    Join Date
    Nov 2002
    Location
    The Space between dreams and reality
    Posts
    86
    ok i figured out how to salve my little problem...well kinda...ok
    i just make 4 command buttons and have each of them move the picture in a differnt direction!

    ok now heres the problem: how do i make the picture move?
    i know what im gunna move to make it move i dont know HOW im gunna make it move.

  13. #13
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I'm not 100% sure if I understand what you mean, and I'm not sure if the problem is my English or yours, but do you mean something like this????????????????????
    Attached Files Attached Files

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