A fly's life is not easy. Predators are always on the hunt. Can you help Mosca the fly get home safely?
In the worlds directory, there are two .txt files provided. Each file represents a different world. You can create your own world of any size and with any number of predators.
The world layout is as follows:
- First two numbers represent the size of the grid (rows must equal columns)
- '.' -> empty space
- 'h' -> home (final destination)
- 's' -> start location
- 'b' -> bird
- 'a' -> spider
- 'f' -> frog
Once the world is ready, point to the correct world file in FlyWorldGUI.main() and run. Note: you also have to provide an absolute path for the image files in Fly.java, Frog.java, Spider.java, Bird.java
How to play:
Use the arrow keys to move the fly in one of the four directions (UP, DOWN, LEFT, RIGHT)
Frogs move randomly to one of the squares (4 directions) surrounding them
- They eat Mosca when they are next to him
Birds can move randomly to any square on the map
- They eat Mosca when they land on his location
Spiders always move towards Mosca (one square at a time)
- They eat Mosca when they land on his location
Every time the Mosca moves, each predator on the map also moves