Does Anyone Know?

Computer_Guy
06-07-2001, 06:16 PM
I'm trying to make an adventure game where the user can move around in a screen, and push around blocks, get keys, you know, sort of like chip's challenge, but anyway. I wasn't in school when we learned how to use matricies, and I didn't learn how to use cases, and I Can't figure out how to push blocks around. I am using a matrix of picture boxes to display the map, and basically want my program to be an engine so that I can put numbers into notepad, and each number represents an image, which I have seen work very well, If anyone can help me, please help me out, thank you

andrewo
06-21-2001, 06:22 AM
im not sure about the notepad thing
but a sorta low level simple way of pushing the blocks is
when u bring your player near the block , say if the player.left = box.left then box.left +1 maybe
well thats sorta how i made a pingpong game...which i am still making...

Computer_Guy
06-21-2001, 10:31 PM
Well, the thing that I was doing was that I used picture boxes for grids, so that it wouldn't be like that, but thank you for replying to that, though.

TommyHM111
06-27-2001, 01:46 PM
ok in your post i saw that you didn't know how to use case statements i don't know if this is what you mean but her it goes.. Select case structures are similar to If...Then..Elseif statemens in that they allow your program to choose from more than two alteranatives. Howeverm the Select Case structure can be more efficiant because it evaluates the test expression only once. The result of the expressiion is then compared against multiple valuse to determine which code block is invoked
the syntax for case is
Select Case expression

Case expressionlist1
[statements]
Case expressionlist2
[statements]
Case Else
[elsestatements]
Endselect

-hope that helps-
__Tommy--

z4mmo
07-02-2001, 11:28 AM
I presume that the picture boxes that you are using are in a control array, why not have a matching integer variable array working whithin your program. If somthing on your grid changes, change the integer array and then redraw the grid. Also you mentioned using notepad for the data file, this is a good idea as you can read the contents of that file into your integer array and then draw your grid to suit !

Hope this helps !

Computer_Guy
07-26-2001, 03:15 PM
Even though this is the first time I have read this question in a month, I have figured out how to use cases, thanks to everyone here, and I have successfully drawn my map and can have a character walk around in it.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum