Project 1: Whale in the Ocean






I wanted to depict the ecosystem of the ocean and how trash can kill animals. A a lot of plastic waste and single use products such as masks, latex gloves, etc, are being thrown away in to the ocean.




UML Diagram for Whales in the Ocean





Using the UML diagram, I identified the properties and methods of each objects. The user would control the whale so that it would eat the krill and avoid eating the trash while moving inside the ocean.
This is the second verson of the diagram where I added HealthIndex() on the Whale. I thought that it would be important for users to know the status of the whale to determine how much more krill it needs



Coding Process













Moving Objects





Challenges
At first I created the elements that would make up the game. I created the ocean, the Krill, Trash, Whale classes. Because this is a prototype, I simply created different shapes and colors. For Trash I used a green Square, circle for Krill, rectangle for whale.

I envisioned that my whale would move up and down on the left screen but I realized that it could be more fun if the whale could move around freely. I translated my diagram into code by seeing what properties and methods I needed. I realized that the diagram was very necessary process because I got to get an overview of what elements I needed to include and organize classes.

In the future, I would like to make it so that the health of the whale can show up on the screen and make the game end once the whale reaches poor health. When I tried to add this part, the whale started to move very fast as it ate more Krill. I'd like to dive deeper and solve this issue.


Final Prototype





The user is trying to get rid of the trash by clicking and dragging it out of the ocean before the whale eats it. However, if the user clicks on the ocean rather than the trash, it creates more trash, which adds challenge to the game.