top of page

On the left is the Rotator Script. This was applied to our main ball, the player, and it enabled it to roll across the floor. The script took into account where the ball was every frame, and then adjusted it according to where you wanted it to go. One factor tat plays a hude part in this script working correctly, is the act of gravity in the game. This si something that can be set back in Unity, and it makes sure the ball cannot fall through the floor or roll right past the walls. Without it, the ball would just rotate into oblivion. 

This is the Player Controller script, the most important one in the game. This script connects everything in the game back to the player, the pick ups, the winning text and the counting of pick ups.

 

Beneath all of the public and private floats and GUITexts, the first thing written places the player in the game. It marks the first spawn point and marks the respawn point, in case the player falls out of the boundary box.

 

Below the spawning, comes the count of the score and the win text. The count equals zero until a pick up is collected, then the score increases by whatever you desire. The win text appears when the set score is reached.

 

The next section is what action allows the player to move. Without the Rotator script, this just allows the player to glide along the floor and work with the gravity. This also gives the player a set speed.

 

The last two sections do the actual respawning of the player. This brings the player back if it falls out off of the platforms. The player would just fall forever if it did not respawn. 

 

 

 

 

The last script is the Camera Controller. All this script does is make the camera follow the player. This is stated very easily, but there was a slight problem.

 

Because the player rotated, so did the camera. We had to write in special instructions to make sure the camera would only follow the players position, not its position and rotation. bout you.

The Scripts

bottom of page