Platform:
-Android
Engine/Language:
-Unity (C#)
Project:
-Individual project,
-Developing mobile game
Perception is a mobile game developed in the Unity game engine using C#. Perception is a puzzle game which utilise the idea of having to change how to look at thing to find the solution. The objective of Perception is to build a shape using blocks on a 5x5x5 grid so when all the walls on the outside move inwards the shape pass thought them.
This is the core concept of the game as it needs the player to not think in one dimension.
One of the challenges that I encountered was how to create each level. There were a few ways I could have gone with this. The first and most obvious being to create all the wall elements at compile time. This is great for prototyping as I could quickly build new levels. However, there was two reasons I didn’t like the idea of hand placing all the object within the scene. The first being the large number of objects which would be present within the hierarchy and the second being scalability. I wanted an easy way to add new levels without needing to change anything within the editor hierarchy or gameplay systems in fear of introducing new bugs. The solution which I went with was to have .json files act as levels. Each .json file would contain all the data need for each level, then when a level was selected from the main menu that level’s .json file would be selected then parsed into a LevelData class which could be used by the LevelManager to generate the level selected.
{ //The title for this level. (Normally a hint for the level) "title": "Tap to place a cube", //The speed of which the was will move for this level. (Default is 2) "wallSpeed": 2, //The life span of each wall. (How many seconds should the wall exist before //disappearing. Default is 4) "wallLifeSpan": 4, //What is the recomeneded number of cubes for this level "recomendedCubeCount": 1, //Define the 3 goals for this level. //Time limit. (Number of seconds this level must be completed in to //accomplish this goal). //Score. (The level score must be equal to or higher to accomplish this goal). //Moves. (The plaer must make less or equal number of moves to accomplish this goal) "goals": [ [ "Time", 20 ], [ "Score", 2 ], [ "Moves", 1 ] ], // "wallMap": [ [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", " ", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", "X", "X", "X" ], [ "X", "X", " ", "X", "X" ] ] }
///With this setup I can quickly create new levels by adding a new .json file to the levels folder. This also would allow other developers who might not understand the systems in place within the game to add new levels which is important for larger teams./// Level Data class to store all data for a level /// [System.Serializable] public class LevelData { public string Title; public float WallSpeed; public float WallLifeSpan; public int RecomendedCubeCount; public LevelGoal[] Goals; public string[][] wallMap; }
If you have any question or suggests about this project or any other project please do not hesitate to contract me