PDA

Click to See Complete Forum and Search --> : Moving an x in a picturebox


bmcwilliams13
May 6th, 2000, 12:27 AM
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.

kedaman
May 6th, 2000, 02:39 AM
What exactly are you doing, explain fürther

bmcwilliams13
May 6th, 2000, 07:33 AM
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.

kedaman
May 6th, 2000, 07:50 AM
How do you want to move around the x? I suppose you can make it gridsensitive by using positionx = int(positionx/32)*32

bmcwilliams13
May 6th, 2000, 07:54 AM
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.

kedaman
May 6th, 2000, 08:01 AM
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?

bmcwilliams13
May 6th, 2000, 08:18 AM
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.

kedaman
May 6th, 2000, 08:30 AM
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

bmcwilliams13
May 6th, 2000, 08:36 AM
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.

kedaman
May 6th, 2000, 05:39 PM
HEhe, if you have anything more to ask about it, just reply here.