git
Jul 11th, 2000, 03:51 AM
Hi all,
I'm writing a game in VB which uses a grid. I'm only a beginner at VB so none of my code is fancy.
I have the grid written, it's 15 x 14 boxes (all Image boxes), so about 200 or more subs in total, all named "x1y1", "x1y2", etc.
When you click on a box, the co-ord. of that box is saved as a data value called "UnitCoOrd". For example, the value may be x5y3, whatever. Then another sub is loaded, called Movement.
I want Movement to do several things to that cube, but I don't want to copy and paste a lot of code into 200 or more subs. The first thing I'm trying to do is to get a picture to appear in the cube. I've got it set so it's like this :
UnitCoOrd.Picture = LoadPicture("C:\ww3\1.bmp")
Which is for eg., if the box clicked is 9,2:
x9y2.Picture = LoadPicture("C:\ww3\1.bmp")
What I want to do is substitute the value UnitCoOrd for that value to load a picture.
I keep getting errors. How can I get around this ?
I hope someone understands what I'm trying to do, it's hard to explain, at least as a beginner. =)
Thanks, cya!
-Git
I'm writing a game in VB which uses a grid. I'm only a beginner at VB so none of my code is fancy.
I have the grid written, it's 15 x 14 boxes (all Image boxes), so about 200 or more subs in total, all named "x1y1", "x1y2", etc.
When you click on a box, the co-ord. of that box is saved as a data value called "UnitCoOrd". For example, the value may be x5y3, whatever. Then another sub is loaded, called Movement.
I want Movement to do several things to that cube, but I don't want to copy and paste a lot of code into 200 or more subs. The first thing I'm trying to do is to get a picture to appear in the cube. I've got it set so it's like this :
UnitCoOrd.Picture = LoadPicture("C:\ww3\1.bmp")
Which is for eg., if the box clicked is 9,2:
x9y2.Picture = LoadPicture("C:\ww3\1.bmp")
What I want to do is substitute the value UnitCoOrd for that value to load a picture.
I keep getting errors. How can I get around this ?
I hope someone understands what I'm trying to do, it's hard to explain, at least as a beginner. =)
Thanks, cya!
-Git