Sheep-ship Ship
SpawnSheep Function
This function is responsible for randomly generating a specified number of sheep within a defined range. I used a loop to create the instances of the sheep prefab. For each sheep, it generates a random position within the defined range.
Function with Parameters
The Collider other parameter allows the function to determine if the colliding object is a sheep by checking its label. Unity automatically passes this parameter when a collision occurs. The code checks if the colliding object is tagged "sheep". If so, it updates the score text, plays the remove sheep sound, and destroys the sheep game object.
Function with Return Value
The canScore controls whether the player can score after the game is over. The initial value is set to true, indicating that scoring is allowed during the game. The condition if (canScore && ther.gameObject.CompareTag("Sheep")) ensures that the score is incremented and the sound effect is played only when scoring is allowed.
Creative Requirements and Design Decisions
The 18-second game duration creates a sense of urgency, motivating players to find and hit as many sheep as possible within the time limit. The randomly generated sheep positions will make the game more playable and possible, allowing the game to take both skills and luck into account. I originally had more grandiose ideals, such as the ship hitting the randomly generated icebergs, but the collision logic in the 3D field took me a lot of time to research, making the time very tight. I think I can do better next time.
Status | Released |
Platforms | HTML5 |
Author | Dennissssa |
Made with | Unity |
Comments
Log in with itch.io to leave a comment.
goooooood gaaaaaaaaaameee
Okey :}