Hi guys,
I recently started using Slick earlier today and I have found it extremely useful. I managed to get a working game prototype up and running in only a few hours (that includes the time it took me to draw and animate sprites).
The game uses a 20 x 20 grid of tiles. When the game initializes, it draws all the tiles onto one image, which takes about 2 - 3 seconds. During that time it displays a black screen, but that’s fine I’m sure I can put a loading screen or something there.
During the game, it is very smooth and I have no problems because I only draw the one image with all the tiles drawn onto it.
When the player presses space bar, the tile under them changes. To make change visible I redrew all the tiles onto the image, but this freezes the game for about a second. I tried only drawing the changed tile onto the image, but it had the same effect.
I also tried to draw the tiles directly, instead of onto an image first. I get a FPS of only 2 or 3 then. So I tried drawing only those within 5 tiles of the character and got a FPS of 14 or 15. An improvement, but the game still wasn’t smooth.
Is there a better way of drawing all the tiles onto the screen so that they can be changed on the fly without the game freezing?