Progress on the arcade space mining game was going well. I have created a *workable* random terrain building class and got landing on (and leaving) planets coded. This includes storing the generated terrains in case the player leaves then returns. I updated the movement of the level when it's a planet type to keep the player boxed into the generated terrain (it's set really large so they'd have to go for a long time before hitting the edge).
Clearly something was about to go wrong.
It was time to swap out the colored squares of the terrains with terrain images (although it's arcade style, drawing in Java is just a pain - I've tried drawing everything in Java in the past, untenable). I created images for the handful of terrain types, and swapped the colors out for BufferedImages.
Kaboom!
Complete IO and processing meltdown. So I went in and made the terrain a collection of image names, and just had single images of each type and then just drew them in the proper places in the grid. This went much better. But it is still horribly tanked. I'm going to adjust the images sizes and lessen the amount of them. I'll also be making sure I'm not drawing tiles that aren't even on the screen.
Perhaps now is the time to bite the bullet and ditch Java for something more conducive - even though I love Java, and am very comfortable in it now.
No comments:
Post a Comment