Thank you for visiting Blazing Games

Solution

If the pixel grabber is grabbing the entire image then the solution is to simply grab the image only once. The problem is I need the pixel data for 64 different pieces of the image. I could break the big image into 64 smaller images and load each one. This would solve the bandwidth problem, but 64 smaller files would add up to more than 85k and there would be your typical latency delays between each file that is loaded. Besides, breaking up the file would be a lot of work!

What if I did one big pixel grab and then copied data from that huge array into the 64 smaller arrays? A bit more complex code is involved, as you can see below, but it should work!

Once I finished the coding, I decided to test the code by running the game off the hard drive. While I wouldn't be able to tell if it solves the bandwidth problem, I would be able to see that the game worked. I ran appletviewer and ... wow! What a boot time speed up! I quickly put together the jar file and upload the new version to my site. Load the game's page and problem solved!

Now, I was obviously relieved by solving the problem. There are a lot of Coffee Quest fans, and I am sure they would have noticed the problem. The thing is, the problem with PixelGrabber was not really a bug. It just happens that the class did not work the way I thought it would work. This is a good reminder to all programmers that they really need to be aware of how the libraries they use work!

Previous Page
Coffee Quest 3 Problem page 5 of 5
Next Page

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2003-2006 Blazing Games Inc. All Rights Reserved