Layout
The whole world is designed in Figma and based on a tile/grid system. The world has 256 tiles. The 5x5 display always renders 25 at the same time.
Tiles
Every tile has 100x100 px and is a row in the tiles table. There it can be filled with a floor asset and an item asset. It can also have a message that is displayed when you look towards the tile.
Assets
Every asset is a 100x100 px SVG, sometimes with transparency. Assets can be obstacles (tree), interactive objects (apple) or just floor to step on. Interactive assets can even require other assets to interact. Assets have a value that can be different from their design. This allows that a chest requires a key and gives you a coin after the interaction.
Limitations
Since the display is 5x5 and the player is always in the centre, it requires two framing rows/cols where the player can’t step on.
Controller
Movement
This is the most complex part of the mechanic. With every step the game needs to check:
What is the position the player is standing at? What is the position the player is watching at? Which are the visible tiles around the player? Is there a message to display? Is there an item to interact with? Is the left or right leg in front? It took some time to find a good mix of what to automatically calculate and what to update with a button. Everything can be done in multiple ways, but with huge differences in performance.
In the end, a movement button saves the new current position into a table. Formulas check the position and calculate the visible tiles around it. Only the visible tiles use some formula to calculate their SVG value.
Interaction & Inventory
Same as with movements, a few things have to happen at once here. If you stand in front of an item that allows interaction, the A button will show what you can do.
I wanted the player to be able to collect items, and also use collected items to interact with other items. I already did that in the Lost in Paradise games and just defined everything as columns in my assets table. But this time there were no emojis to display and I needed to render the collected items somehow – e.g with an inventory screen. For the backpack I had to create an own grid system and show collected items in the right order.
Layout of a world in Figma.
Tile showing a message after interaction.
Two tree columns as a limiting wall
The controller
Legs indicate movement