Press left arrow to throw the trash to the recycle bin, press right to throw to the non-recycle bin. 

Get 45 points before running out of time.

Lecture Requirements:

void ThrowTrash(Transform targetBin)

I used a function with parameter to direct the trash thrown to the trash bins.  

bool IsTrashCorrect(GameObject trash, Transform targetBin)

A bool function with return is used to check is the trash thrown into the correct bin or not. It will return "true" or "false" based on the type of trash and type of bin. 

void ChangeTrashDirection(GameObject trash)

I also used other functions to change the direction of trash

Creative Requirements:

I drew all the pixel art in the game, including the two trash cans and the types of trash in the picture. I deliberately adjusted the color of each type of trash to indicate to the player. Recyclable trash tends to be cold and non-recyclable trash is warm. In addition, I also added different feedback for correct and incorrect throws. If the throw is correct, the trash will disappear immediately when it hits the trash, and a sound will play. If the throw is wrong, the trash will be bounced off the trash can and another sound will play, and it will disappear with a delay of 0.5 seconds. Therefore, the next batch of trash will also appear later, which is a slight failure penalty that increases the difficulty of the game.


https://github.com/BediRuan/TrashGame

StatusReleased
PlatformsHTML5
AuthorBoom Guy
Made withUnity

Leave a comment

Log in with itch.io to leave a comment.