unitygame | My Site
top of page

Unity Platform Video Game


    Due to the rise in the popularity of platform games such as Only Up and Jump King, I decided that I would like to learn how to develop these games. Initially, I didn't know what game engine I would like to dedicate my time to learning. I couldn't pick between Unity and Unreal Engine but ultimately chose Unity due to the better documentation and since it uses C# for scripting. Though I didn't know any C# at the time I did know Java which has very similar syntax.

    Initially, I had to create a player object so I could add physics components and scripts to

make the game function. I had to add components that made it so that the player had a

hit-box, walk, jump, and fall. Thanks to Unity's "rigid body" component I could make it so

that the player is affected by gravity and cannot phase through solid objects. The way that

the player's jumping abilities were scripted was increasing the player's upward velocity as

long as it is standing on an object.

    Once the movement was taken care of, the next step was animating the player's movement so that it faces the side that it is moving. This was achieved by using Unity's animation component. I had to feed the component different animations of the character and it would play them based on the inputted parameters. For example, if the user inputted leftward movement the left movement animation would be played, and once the user stopped inputting leftward movement the idle animation would be played. 

    A challenge I experienced was making the sky in the background look distant. Thinking

back to one of the games I grew up on Terraria I remembered that in that game the

background moved in the opposite direction of the player at a reduced related speed.

    The final implementation of the game was the timer because people often play platform

games with the intention of speed-running them. To display the duration of the run I created

a text box in the corner with a script. The script starts counting milliseconds since the game

started and stops counting once the player lands on the final platform all while updating the

text box to display how long it has been.

    Below I have included the download to the game if you would like to try it out. All you need to do is unzip the folder and run the "Sky Platform" executable.

bottom of page