Posts

Gamespace: PickUp Collectable Items

Image
I created a way for my items (mini balls) to be picked up by my player. I also added a particle system so that when the balls were picked up, they almost 'exploded' making the Gamespace more interesting. My particle system before changing the values My particle system after changing the values This was the first 'PickUp' script that was used so that the player could collect the items. The ParticleSystem named 'particles', the Renderer named 'collectableItem' and the Vector3 named 'ball' were all made public so that they could be edited in the inspector. The function 'OnTriggerEnter' was used so that if something (the player) collided with the item, this function is triggered. The if statement states that if an object has the tag 'Player' and has collided with the item, the particle system will play (Particles.Play()), the components collider has been disenabled so that it cannot be picked up again, the ...

Gamespace: Moving Platform

Image
Moreover, I wanted to include a moving platform to make my Gamespace more exciting and add difficulty. This functionality was added before I re-coloured the assets. Platform moving up Platform moving down The 'Moving Platform' script is attached to the moving platform in the inspector. Moving platform Inspector The 'MovingPlatform' script declared the Vector3 variable 'initialPosition' as private meaning that the value does not need to be changed outside of the script in the inspector. My initial position which can be taken from the command 'transform.position' is stored in the 'initialPosition' variable. The transform.postion is set every frame and equals wherever I was located initially (stored in initialPosition) with the addition of an offset where a new 3D vector is created. The X-axis is equal to zero, the Y-axis is equal to a Sin wave that alternates multiplied by five to give a larger wave meaning that th...

Gamespace: Windmill

Image
I created the functionality for the windmill before re-colouring the assets. I added a rotating windmill to add more obstacles to the gamespace making collecting the items more difficult for the player. Windmill Game View The inspector for one of the windmill arms shows that the 'RotatingWindmill' script is attached to it and the speed of the windmill arm is going at 0.44. Additionally, the other windmill arm has this script attached to it in the inspector and is also travelling at a speed of 0.44. Windmill Arm Inspector The 'RotatingWindmill' script allows the windmill arms to rotate around a point at a speed per second. The float variable 'speed' has been made public meaning that this value is editable outside of the code. The rotation command is transform.Rotate. A new 3D vector has been created to tell the windmill arm to rotate at a specified speed on the X-axis and nothing on the Y or Z-axis as these values have been set to zero. ...

Gamespace: Camera & Skybox

Image
I wanted my camera to follow the player when in the Game View and therefore set my camera to follow my target. However, this led me to not being able to see the ball. Therefore I had to add an offset so that the ball could be seen so that the player could see where they were going. The 'Follow Target' script was attached to the Main Camera which allows the target for the camera to follow to be set and allows values for the camera offset to be changed directly in the inspector. Camera Inspector The inspector for the skybox asset allowed me to set the image used as a panoramic and change the image type to 360 degrees. Skybox Inspector The 'FollowTarget' script allows the transform variable 'target' and the Vector3 variable 'offset' editable outside of the script as these were made public. transform.position sets the transform position to equal the target's position (The player's position (sphere)) with the addition of an offse...

Gamespace: Player

Image
Next I decided to add functionality to the sphere so that the player can control the object in the Gamespace. Player controlling ball in Game View The sphere needed a Rigidbody in order to use gravity and not fall through the floor. The 'RollingBall' script was attached so that the player could control the ball using keyboard commands and allowed a force to be multiplied and added to the ball. Player Inspector The variable 'ForceMultiplyer' was declared as a public float so that the value could be edited outside the code. The 'forward' and 'right' variables are set to zero as a default. The if statement states that: If the 'W' key is pressed move the player forward = 1 on the Z-axis causing the player to move forward. If the 'S' key is pressed move the player forward = - 1 on the Z-axis causing the player to move backwards. If the 'D' key is pressed move the player right = 1 on the X-axis causing the player to mov...

Gamespace: Landscape Progression

Image
I imported the 'Nature Pack' into my Unity Gamespace from a website named 'Kenney' which has free assets that are available to download. Nature Pack Using these assets I began creating my landscape. Landscape Scene View Landscape Game View When I was happy with my layout and design, I created a sphere that the player will control in the Gamespace. Sphere  in Scene View Sphere  in Game View I decided to add materials and a skybox to my Gamespace to fit the theme of  'the sky', giving the player the sense that the platforms they are jumping onto are objects in the sky e.g. clouds. I recoloured Kenney's assets to give my Gamespace a more original feel. Coloured world in Scene View Coloured world in Game View Bibliography & References [1] https://kenney.nl/assets/nature-pack

Gamespace: Target Audience

My target audience are people who enjoy playing platformer games such as 3D Mario platformer games, spyro, Hollow Knight etc. People of any age range can play this game as long as they still have the dexterity to press certain keys quickly therefore this may not be the best game for someone who is elderly.