-
May 25th, 2012, 02:22 AM
#1
Load/Unload Object PROBLEM
Hi everyone,
I am currently making a tetris game where I will load 4 image boxes for each piece. Every time I clear a line, I put the cleared line's image boxes to .left = 0 and .top = 0.
However, I have realized that after loading too many image boxes, my program becomes very laggy. Therefore I decided to try Unloading the image boxes after the line has been cleared, but then I get an error message from a part of my code where I use this something like this to control my image boxes:
For Index = 0 to IndNum
Image1(Index)....
......
......
Next
So basically the entire "For" process becomes messed up because it is missing an object which I no longer need. Is there a way around this?
Thanks
-
May 25th, 2012, 07:58 AM
#2
Re: Load/Unload Object PROBLEM
I'd have made a usercontrol for each piece. This will be a combination of the four pictureboxes. Being just one control, it would have saved you a little bit of memory, and made your program more manageable.
Anyways, have a look here :
http://www.freevbcode.com/ShowCode.asp?ID=2815
http://www.tek-tips.com/faqs.cfm?fid=3906
-
May 25th, 2012, 08:10 AM
#3
Re: Load/Unload Object PROBLEM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|