LoneStranger’s Islands Update – Map Loader and Player Movement
Since my last update, I’ve worked on the player movement using KeyPressed and KeyReleased, so it moves whenever the keys are down and doesn’t fall victim to the keyboard key delay. I also implemented some bounding boxes so that the player cannot move off the screen and cannot run into other objects. Their bounding boxes don’t have to be the entire tile, but they are limited to being rectangles. I would have liked circles or an array of rectangles, but I think that’s more than I need at the moment.
The level manager is working with the tile manager to load levels. I can now edit a text file and make changes to the map. It’s stored using a basic text format with some metadata and a grid of letters, numbers and symbols to determine the tile types. Here’s the most recent screenshot.

TileManager and LevelManager are loading levels from text files.
You can see my bounding boxes in the image. The tiles and the player have their own boxes and the player’s box cannot overlap it without the collision detection saying that he can’t move there. The cyan colored box on the inner edges of the W’s is actually a reverse bounding box. The player’s bounding box must overlap that box at all times, or the collision detection will not allow the player to move. This is just a trick to keep the player from moving off the screen. At the extreme, the player’s box will overlap by one row, and at that point the player is in the outside edge of tiles.
Now I am going to move from using the generic GameTile class to more detailed tile classes for each tile type. After that, I believe it’s time to scan the doodles and put in the final graphics.
Tags: ld48_17, screenshot