Sunday, 2 June 2013

Setting the Game Attributes

With the creation of my title pages I am now going to start the game development process for my Final Major Project. My first goal with this level is to create an environment that I can walk around and have a few platforms to jump from one to the other.
When creating a game in Unity that is predominantly 2D we need to understand the common principles that will stay consistent in order for the project to function. To start off we need to define our plane of motion for all of the gameobjects. In order to prevent this game from being three dimensional, one of the dimensions must be restricted from motion. For my game, I’m going to choose the X-axis to correspond to horizontal movement and the Y-axis to correspond to vertical movement. The Z-axis will therefore correspond to movement to and from the observer (or camera), this will inhabit no character movement within it. In order to easily memorize the planes of motion, when I click upon a Gameobject within the Scene-view, the red, green and blue arrows represent the directions of X, Y and Z.
The second principle I'm going to be sticking to is the restriction of rotation. The only rotation that will be present within the game will be around the z-axis. This is due to the camera passing through this axis, which results in clockwise and anti-clockwise rotation. The only exception that will be used for this rotation is the Y-axis so he can turn from side to side in mid-air.

In order to help enforce these principles I'm going to use an object called "Level Attributes" that has a script with the same name attached to it. This script does a whole variety of environment setting features, these features do the following:
  • Displays the level's dimensions within the scene-view by drawing a green bordered rectangle.
  • Creates a physical collider that acts as a border to stop objects falling infinitely or users going beyond where they should be going.
  • Allows the user to optimize the position where the physical colliders start and how wide/high they are away from the position.
  • Gives the character room to fall without the camera following it until it hits the bottom collide.
So now we have a script that creates an area for the character to move up and down the X and Y axis, however if the character were to fall to the boundry of this area nothing would happen. This is where we implement the Death Zone object that has the "DeathTrigger" script attached to it. What this script does is that it provides a collider which causes the character to respawn if they fall onto it, this is a great feature for small pits or the whole level itself.

No comments:

Post a Comment