Results 1 to 10 of 10

Thread: Moving an x in a picturebox

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Question

    I have a picturebox with a solid colored background which I created, and I'm wanting to make it where I can put an x on the map and move it around as if it was in a 32x32 square hopping between squares.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    What exactly are you doing, explain fürther
    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

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    I'm wanting to move the letter x around in a picture box which is just one big picture. But I'm wanting to make the x move around as if the big picture was split into 32x32 squares. Or if you can't answer that, then tell me a code that can replace pictures for numbers so that I can design the background with numbers and it will show up as pictures, and then tell me how to move the x around inside of that.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    How do you want to move around the x? I suppose you can make it gridsensitive by using positionx = int(positionx/32)*32
    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    I'm wanting to be able to move it around with my mouse and a button. Also, I'm wanting to be move one space a time only going up/down and left/right, no diagonal.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Why??!?!? Just tell me what this app is about? Why does it need to ignore any diagonal moves? Is the mouse controlling the x indirectly? whats the button for?
    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    I just want to be able to move an x around which I will eventually make into a guy. All I want to be able to do with my game right now it to move a guy around on a screen. I guess it can move in diagonal, but my guy is suppost to move one space at a certain speed depending on his equipment. And I'm afraid that by making the guy move diagonal it might screw up that whole idea.

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking

    Well i can't give you any direct code here because you're asking to create the game but i can give you some tips in doing this:

    1. make your form autoredraw
    2. Put two variables for the x position
    3. use a mainloop to do the movements by putting timering functions and doevents
    4. Do cls and draw the guy at the position
    5. Put two variables for the x movement direction
    6. Put in keydown event it respond to vbkeyup,vbdown,vbleft and vbright and change the direction variables
    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.

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Arkansas
    Posts
    15

    Talking

    Thanks for your help kedeman *sorry if I mispelled that*. I think I get what you're saying and I can turn that into some code. Thanks again.

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking

    HEhe, if you have anything more to ask about it, just reply here.
    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.

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