Bonus Features 2 - Hard Work!
Vertical Player movement was easy to implement, with just checking for key strokes and using transform on player object. Adding Box Collider (isTrigger) and Rigidbody to the player was easy enough, with a new Script generated to deal with the collision. In editor I placed a tag I named "Enemy" on Animal Prefabs, and in script within OnTriggerEnter I checked if "other.gameObject.tag == "Enemy" so I could then print Game Over. Animals spawning on sides of screen as well as top, was difficult. I used the Random class to make a 50/50 chance to chose whether to have the Animal spawn co-ordinates on top of the screen, or on the sides (with another 50/50 to chose left or right in that case). Each case needed to have the animal rotatation altered to ensure it ran the right way. Game User Interface was very difficult, but once I learnt more about the GameObject.Find() method and GetComponent<T>() method, I finally figured it out. Too keep track of player lives and score, I created a script attached to an empty GameObject in the scene. I then referenced this in other scripts when needing to modify or reference these values. l did this via creating a Script Type variable in any other script I needed to, like below: public ScoreAndLivesManager ScoreAndLivesManagerScript { get; private set; } Then I used the aforementioned methods to find the GameObject in the scene with that name (as listed in Hierarchy), and grabbing the reference to that component to my prior created variable, like below: ScoreAndLivesManagerScript = GameObject.Find("ScoreAndLivesManager").GetComponent<ScoreAndLivesManager>(); Creating the UI for the HungerBar of the animals was hard. After looking online a lot, I figured out how to create a Slider UI to the pre-fabs Animals within their Hierarchy. I then created a Script Component on the Slider Object. In the script I created some integer variables for maximum and minimum health, but more importantly, I created a Slider type Varible and RectTransform Varible which I would use to reference the Slider component and RectTransform component, allowing me the potential to change the values of the Slider to reflect the hunger level of the Animal and rotate it within the scene. Using Methods created in this script, I then referenced the HungerBar script in other scripts using the GetComponents methods, and used my methods to access the Slider to reflect changes such as increasing the Slider when the animals are fed, and de-spawning on full Slider. Also, rotating the Slider when the animal spawns. Took me like three whole days, many hours each day, to figure it all out - shoutout to ChatGPT and random YouTube videos for when the documentation is to dense to understand.