Tayyaba Hafeez

Assignment 5: 2D UFO Modifications

IT-201-004

First of all, I download the 2D UFO from the unity assets. Then I started following the tutorials according to these points. I downloaded the sprite sheet of my character which is from the unity assets. I change the characters into sprite sheet which separate each action in a different sprite. After this. I downloaded the background file from the unity asset which has different part. For this particular assignment I have used the one combined background which is not divided into different sections. The first task was to create a scene and then change the background sprite of this 2d game, so I changed it by clicking on hierarchy, then click on the create to create a create empty and named it background. I drag my background png folder into this background. After this I opened the folder and drag and leave the background image on the scene area. I set the colliders with the background image so that my player cannot move outside the background image. Box collider is an option which we can add under the inspector by adding a component and selecting box collider 2d. It gives us options to edit colliders and add other effects on the edges of the background like material, auto tiling, effectors, sizes. In my game I added four colliders to cover all four sides of my background. By doing this, we make obstacles for our player to not to go outside the boundaries. There are other ways to add obstacles within the scene where the player can jump, fly, or climb etc. In my game the player is collecting “Kunai” which she is going to use later to kill the enemies in the game. So, when the game starts, the music starts which I have added in the hierarchy tab. Before I downloaded the music then I made an audio object and script for this. Another thing is the main player, first of all, I changed the character into sprite sheet, in the hierarchy tab I added a player and in the inspector tab it shows different options such as transform where I can set the position of the player. Here, I can select the X, Y position of the player. For now, I have selected the -0.06X and 0.57Y axis. I haven’t selected any Z position because it’s a 2D game. Another important thing is sprite render where we can also drag the sprite of an idle player to show the character on the scene. Also, I made the rigidbody 2D which is important because it selects what kind of body does our character has. For my character, it dynamic and the material used is physics. I have also used the linear drag up to 5 because it helps moving the player slowly and smoothly. Otherwise, it won’t be smooth and it’s difficult to control the player movement and rotation with this. Another important thing to mention is the constraints where we have the freezing option. This is used to control the position and rotation of the player. As my game is 2d so I freeze its Z rotation because I don’t need it. In the circle collider 2d, I can control my players collision which means if my player will collide with something it has to picked up or collect, for this purpose we use the circle collider 2d. when it will touch the pickup thing, then that thing will disappear from the scene. Here we can also add animations into the scene for showing the movements of a character either its running, walking, jumping or throwing. For each and almost every action to be performed in the unity we would have to make a code in the script tab to make our character function so I have added all the scripts in the script folder under the assets. 

StatusReleased
PlatformsHTML5
AuthorTayyaba
Made withUnity

Leave a comment

Log in with itch.io to leave a comment.