Two Friends is my submission for the 2022 Epic MegaJam, a week-long game jam contest. The given theme was "As Above, So Below". The game focuses on two friends, separated by a natural disaster. One is above ground, the other below ground, with items in the environment linked together. The player must manipulate the mirrored environment in a way to allow both friends to move through the world and reunite at the end.
The game uses a series of doors linked together as puzzle elements. When one door moves its linked door also moves, though not necessarially in the same orientation or direction. This system can be used to create puzzles where the player must clear a path for both friends to stand on a green square and proceed to the next section. In hindsight this system is relatively simple and by the end of this jam I had minimal time for puzzle design, and the layout as a whole suffered as a result. I could envision adding more types of linked items, like floor movers or wall rotators to help add some complexity to the puzzles.
This Blueprint manages movement for linked objects. It starts by casting all items in the Objects array to BP_Door (the only interactable in this project) and setting their "Linked Objects Controller" reference to self. This establishes a communication path between the door and its respective controller.
On each Tick, it will check to see if any of the doors it manages are being controlled. If true, it will set the relative location of each door to the same relative location of the door being controlled. Using the relative location allows for doors to be rotated differently from each other to create interesting puzzles.
This Blueprint manages movement for the player as well as interactables. It required a special setup since the screen is split into two sections, so this Blueprint actually manages two separate player controllers.
Each time a click happens, it starts by establishing what side of the screen was clicked, and saving the corresponding player controller for later.
Then it checks to see if an interactable was clicked. If true, it will save information about what interactable was clicked and its starting position for later.
Then comes a player movement section, which is only run if we didn't click on an interactable. In this case we pass the mouse position to the appropriate player controller so the player will stop moving if they are already moving.
When the mouse is released, it will either move the player, or reset the currently-clicked interactable, depending on what we clicked on.
Finally, there's a Tick function which will only run if we are currently clicking on an interactable. If true, we will update the position of the interactable based on the mouse position, and this position will propogate to the other doors that are linked to this one thanks to the Linked Objects Controller.