Centipede CGP
Centipede CGP - ReadMe File
Author: Stone Aerni
Modified: 2024-11-10
1. What are the controls to your game? How do we play?
Use the arrow keys to move the player, and press spacebar to shoot. Destroy the mushrooms and the centipedes to gain points. If you get touched by the centipede 3 times, then you lose!
2. What creative additions did you make? How can we find them?
Did not make any creative additions to the game.
3. Any assets used that you didn't create yourself?
Got assets from https://github.com/zigurous/unity-centipede-tutorial/tree/main/Assets/Sprites
4. Did you receive help from anyone outside this class or from anyone in this class that is not in a group with you?
I did not receive help from anyone in or outside the class, besides the instructor Jeremy Bond.
5. Did you get help from any AI Code Assistants?
I had Copilot explain to me how {get; set} and {get; private set} works so I was able to use it in CentipedeSegment.cs - I decided to use a list to keep track of each segment in the centipede, and the AI taught me how to make sure that other scripts were not able to accidentally change the list, while they were still able to read the list if needed.
I also had Copilot explain to me how to use OverlapBox. I wanted the centipede to check when it should move down a row, rather than hitting the object first and then moving down. With this, the AI also taught me how to make a LayerMask so that I can have the centipede check for multiple objects at once, rather than just a specific object. This way, the centipede can check to see if it will run into a wall, a mushroom, or another centipede all in one line of code. Check Centipede.CS for the LayerMask and also CentipedeSegment.CS for the OverlapBox.
6. Did you get help from any online websites, videos, or tutorials?
Tutorial on how to change the sprite of an object within a script
https://gamedevbeginner.com/how-to-change-a-sprite-from-a-script-in-unity-with-examples/#:~:text=To%20change%20a%20Sprite%20from%20a%20script%20in%20Unity%2C%20create,match%20the%20new%2C%20replacement%20Sprite.
Tutorial on how to set an area for the centipede to change directions, along with the GameManager for setting up the scoring and management of the game.
https://www.youtube.com/watch?app=desktop&v=QvdEBjqw0a8
7. What trouble did you have with this project?
The splitting of the centipede was a horrible process, and took me about triple the time that I thought it was going to take me. After Professor Bond helped me in class, I realized that I should've been using a list to keep track of the centipede segments rather than an array. I also found it very difficult to use two different prefabs, "head" and "body segment" and decided that it would be easier to have a single prefab and just change the sprite if it was the head.
8. Is there anything else we should know?
This project was very difficult but absolutely necessary for me. I believe that the struggle was worth it, and that this project has definitely helped me grow my skills as a game programmer.
Leave a comment
Log in with itch.io to leave a comment.