Question: Is there any technique for efficiently prefetching LOTS and BIG images in java?? I'm making this game. it's a fighting game. the background image is 1000 X 600 and   i have 2 fighters, each with about 372 images of 400 X 300 size. each move is created by using an array of images. and each animation/move  ( punch, jump, etc ) has from 1 to 30 images. ( 1 for duck,  30 for walk, 21 for jump etc. ). I thought that my game was finally going to work when i had one player in the screen only . it was working actually, with almost no flaws, but as soon as i a dded the second player to the screen, you can see the updating gets slow...it kind of looks like slow motion sometimes, andthen, images start disappearing as i execute different moves. \n\nwhat can be done?

Answer: I would recommend breaking down your images into tiles. Large images don't run well because graphics hardware is optimised to take smaller chunks of data at a time.\n\nThe other thing you can do is not write it in Java lol. Because of Java's virtual machine nature, it doesn't perform well on real-time tasks like games. If you translated your code line-for-line into C, I bet it'd run almost twice as fast, even before optimising it with tiles. I'm guessing a complete re-write isn't an option, but at least you for next time :)\n\nRawlyn.
This question from the Yahoo Q&A forum is categorized in the topic: Computers & Internet