I researched into what makes a good puzzle game and came across many good Youtube videos made by game developers and reviewers. One of these videos was made by a Youtuber called "Game Maker's Toolkit" which looked into the methods used to create and test puzzles by Jonathon Blow - the designer of the puzzle 'platformer' game 'Braid'.
A good puzzle game requires more than just puzzles, it requires good character writing and narrative. For the puzzle game to be engaging interesting and fun puzzle mechanics are required or the puzzles need to frame the interesting story and world well. It is important that the game has least one of these characteristics. The 'Portal' franchise has a perfect combination of these two successful characteristics due to it's revolutionary puzzles, humorous writing, darkness and mystery.
Within a puzzle there is a:
-Mechanic (what the player can do)
-Rule (how they are supposed to use this mechanic)
-Consequence (the result of using the mechanic in the way that you did. Changing the rule can completely change the outcome of the puzzle)
-Misdirection
Misdirection is used to suddenly flip the players understanding of what they were supposed to do and how. This can be done by changing the order that objective needs to be completed and having logical contradictions where completing one puzzle undoes the progress you made on another.
I kept these notes for later so I can consider them as I design levels and puzzles in the future. I knew that one of the main mechanics to the game would be the ability to create another body, although I was not sure if this would take place upon the players death or at any point, either way I thought it would be important to introduce the code to trigger this event now.
Here is the script that I created for the respawn system. I had made a checklist before hand so I knew what the program had to do and I could tick off each event knowing that I had everything it needed. This checklist included:
-Prefab with RigidBody2D, BoxCollider2D components and a "weighted" LayerMask. (Prefab of the player but without the movement script.)
-Instantiate this prefab at the location of the player
-Move player back to the respawn checkpoint
I created a script that completed these tasks however the 'dead body' prefab was being spawned with the player at the respawn checkpoint, this was because the code spawning the dead body and the code moving the player took place at the same time. So to fix this problem I made a delay lasting 0.000001 seconds between the lines of code so that they would not interfere with each other. This script is shown below:
I had to use a co-routine and not a void function as a void function doesn't allow me to add delays between code which was important to get this code functionality correct. With this respawn trigger working perfectly I decided to test this mechanic in a simple level.
This simple displays the use that the respawn ability can have. Even though the scene was very simple quite a bit of work had to go into it as I had to create animations for the lift and the pressure plate, each having their own animation blueprint with transitions and parameters that required to transition into the correct animation.
The image on the left displays the test script that I made for the pressure plate and on the right you can see the settings and public references I made for the script to work.
Comments