Reference no: EM132106373
For this program, you will develop a C# windows application that will allow a user to play an animal simulation game.
You will need to create a base abstract "animal" class with an abstract "move" method and a set of derived concrete classes for: "cricket", "frog", "bird", "mouse", "snake" and "hunter". Each animal will move around randomly on a board in a different way and displaying different move behaviors.
You are welcome to define the movement behaviors you wish, e.g., cricket will jump one square on the board during each "time advance" period, while a bird may fly two or three or more, while a hunter is more static waiting to have a bird in sight (assume the hunter can only "see" up, down, left and right on the board).
For ease of implementation you can assume that if an animal moves off the board on the right, it reenters in the left (likewise, left to right, top to bottom and bottom to top).
In other words, you can use a modulo function to bound the locations in the board after movement. When another animal is close to a "higher" animal, it can be eaten or killed (e.g., a frog eats crickets, a hunter kills birds and snakes, a mouse kills frogs, a bird also eats crickets, a snake eats mice and frogs. Define a board, say 50X50 and display a number of each animal (including hunters) on the board (you can use image files to display each animal on the board) and provide a set of buttons for the user to control each iteration.
During each iteration, each animal will move, after the new positions for all animals are set, the lucky ones (have food close by) will eat, the unlucky ones will be eaten or killed. Make sure that two animals do not sit in the same square.
Allow the user to set parameters (like, number of each kind of animal, how close food needs to be in order to eat it, etc.) either via menus, buttons, drop down boxes or whatever GUI control you find appropriate. It should be a fun assignment in which you have to use inheritance, and polymorphism as well as some of the GUI facilities of .NET.
Document any assumptions you make (e.g., hunter can kill only neighboring snakes but can kill birds up to N locations away) EXTRA CREDIT:
You can use a timer to advance the game (say animals move every X seconds, for example) and provide a "next" button that will trigger movement from all the animals with the possibility to flip between manual movements using the next button and automated movements using the timer.
Limit movements to prevent animals to move off the board and re-enter on the other side. E.g., if an animal is in a square on the first row, it can only move left, right or down, but not up.