Mechanics Implementation


Mirrorformer aims to have two primary mechanics that the player can use to solve the games puzzles, changing shape and splitting the player object into its two reflections.  As this is my first game jam and only my second game I wanted to keep it simple and stick to a smaller scope. 


After writing up a first draft of a game design document I decided to start by implementing the shape change ability. This ended up being a fairly simple process and was made in such a way where it would be easy to add more possible shapes if I chose.  The system itself is quite straightforward, each shape the player could turn into was assigned a number, this number was stored in the "current_shape" variable and is used when the collides with a shape transformation tile to apply the appropriate shape or checked by a gate object (yet to be implemented at time of writing). Whenever a transformation occurred, the player object's script would hide the sprites of the other shapes and show the sprite of the current shape. 


The next mechanic I had to implement was the splitting into reflections ability. This would be quite important to add as it was a key part of many of the puzzles I had envisioned in my head. Although seemingly quite a simple feature in theory  it has so far been much more difficult to add than I first thought.
My first attempt  involved the player storing its current direction as an integer; 1 = up, 2 = down, 3 = left and 4 = right, after every move the player made. This would then be sent in signal form to the root node of the game which could be passed on to the player reflection objects with one going the same direction as the data and the other going the opposite way. I'm unsure as to what the reason for this not working is but it didn't. In testing the directional data from the player did seem to get passed to the reflections correctly however I was not able to get them to move.
My second attempt, and the one I'm currently tweaking to see if I can get to work,  is to have the player broadcast a signal to the game root node upon colliding with a mirror tile. The root node will then create and instance of the two reflection objects, both of which having their own movement scripts and input detection. After this the player node will removed from the level until both reflections objects collide with a mirror when this process will be re-run in reverse. As I am still very new to the Godot engine I don't know if this is a process that can work just yet so I may well have to come up with many more possible solutions.

Get Mirrorformer