Developing the Game
After the lessons and following the online tutorial I got to the final basic game, where a spaceship would shoot asteroids and gain points. There wasn't too much to the game and I wanted to progress it further, and to start I wanted to add in an AI enemy that would follow the player.
AI Enemy
Creating an AI enemy took me a long time, I went through a variety of different tutorials and scripts testing them and none of them seemed to work. I then started to combine different ones and created the script being used within the final game, however the issue with this is I couldn't figure out how to make the enemy avoid the asteroids so if it hits one it explodes.
I also created a script to spawn the enemy into the scene, I took the code from the GameController script and edited the details in the Inspector to make the enemy spawn once in a while. And finally for the enemy I added in a shot, however initially the shot wouldn't affect the player at all so I had to play around with the scripting and settings of that until it made the player explode on contact.
Changing the Models
The next thing I changed were the models for the asteroid, the spaceship, and the enemy. I used the ones I created in 3D Modelling, which also took a lot of searching to do because I wasn't too sure what I needed to export the models as. I sound found out they were to be exported as FBX files, and once they were bought into Unity the materials were with them which was useful. I then swapped over all the basic models for mine, and I did this by placing the model in the Hierarchy and making sure it had all the same aspects as the basic model. However this bought up issues as well, mainly with the spaceship as it seemed to be at the wrong angle so I had to change it a bit in Maya and import it again, but I got it working in the end.
The next challenge came with the enemy model, this is because I was importing my UFO model and I wanted to get it animated which was incredibly awkward to do. It took a lot of playing around with different settings and searching on the internet to finally get the animation to work with the model, however even then it was rotating in a large circle instead of around one axis. This then also took a lot of playing around in Unity until I finally got the UFO to animate around a single axis.
Scrolling Background
For the scrolling background I worked off of the script provided in the assets folders, it basically runs off of Math functions which make the background scroll and loop at certain intervals. I had to play around with the placement of the background, and even had to duplicate it so that when it looped it looking seamless, plus I had to play around with the speed until I got it to the point I wanted it at.
Main Menu
The final extra aspect that I created was the main menu, it allows the player to start the game or exit the game from the menu screen, it also shows the title of the game. This also took some searching on the internet to figure out, however it was actually pretty easy to create. All I needed to do was add in some scripting for GUI Buttons, which would then lead the player to the correct Application.LoadLevel. The options for the GUI Buttons took a lot of playing around with because they weren't quite in the right place when the screen loaded, all it took was changing around the second options for Screen.width and Screen.height. I also added in the scrolling background, the title of the game, the spaceship, and the music, mainly because this makes it a more interesting main menu.
Evaluation
Overall I feel okay about the game, it has the basic tutorial version of the game with added extras and has made me learn more about scripting than I knew before. With the lessons and the online tutorial I have definitely learnt the basics of scripting and Unity and actually I really like it, I can even go off and create my own scripts confidently and fix them if they break. However there is still a lot I have to learn, but I will search the internet for more information and start to learn more in my spare time.
On the final game itself theres still a lot I want to do, these are the following:
- Make the UFO avoid the asteroids
- Create a scoreboard
- Create levels which get harder over time
- Create my own music and background
- Make it multiplayer
- Get it working on multiple platforms
I did try a variety of these things within the game but they never seemed to work out for me, I think it was because I didn't completely understand the scripting for them however with more practice I hope I can come back and work on the space shooter further.
With Unity itself I never really felt overwhelmed or worried about it, in fact I understood the majority of things within the program and scripting especially once I'd researched into each of them terms. This has allowed me to confidently progress further in Unity, where I found new tutorials and scripts to use, and even started one of the other tutorials on the Unity site to improve my skills further. Also I will definitely think about using Unity again within an art piece, for me its really simple to use and script within plus there are endless tutorials on the internet of how to do certain things.
No comments:
Post a Comment