Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Array as Parameter

Status
Not open for further replies.

Stainnd

Programmer
Jul 9, 2001
65
US
I have a game i'm working on just for fun to fool around in QB with. The techniqiue i use is to have each indiviual file as a 16x16 GET/PUT thing, and then have a 'map' of a bunch of these 'tiles'. Anyway, when a user, say, destroys a chest, I want the tile formerly known as chest to become a floor tile. I could edit the map then redraw it, but that adds a very amateurish look to the program. Instead, I want to re-put the image onto the same spot (thus negatting the first image and creating a blank space), and then put the new image in its place. To do this, I created a function that called ToggleTile, with two parameters, the position of the tile (1 = above you, 2 = right, etc.) and the name of the tile. When I declare my 'tiles' I use DIM SHARED floor(256). In my function, when I need to PUT the images, I need the array name that I have to put. I defined my SUB as ToggleTile(tilenum%, tilename(256)). I then passed in one of my 'tile' images, but it gave me a parameter mismatch error. How can I fix that? Thanks

-Mike -Mike
 
Hrmmmm...

DIM SHARED floor(1-16,1-16) would seem like a slightly easier way to track a 256 tile floor map (row 1-16,col 1-16), instead of having to keep track of 256 tiles w/o any heirarchial addressing scheme. Who knows, maybe simplifying that portion of your task will make it easier for you to solve your param. mismatch error.

Anywise; in more direct relation to your orig. question, could you give us a slightly larger view of your code to look at, that might make it easier for someone to see the problem.

:) -Robherc
robherc@earhtlink.net
(Anybody remember me? ;-)
 
Actually, if you have a quick computer you could use your first idea. Use screen 7 and just use the page swapping while you redraw the screen. I'm making a mario game like this and it looks really good
 
Could you help me out w/ how to do the page swapping thing? My other idea was a little different, and I've heard of what you're saying but I don't know how to do it. Thanks -Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top