Question: please use java code to do it Game 1: A Pathfinding (50 Marks) The objective of this program is to implement a game with a

 please use java code to do it Game 1: A Pathfinding
please use java code to do it
(50 Marks) The objective of this program is to implement a game
with a tiled search area that has obstacles. The search area is

Game 1: A Pathfinding (50 Marks) The objective of this program is to implement a game with a tiled search area that has obstacles. The search area is a 16 x 16 grid with some obstacles, a start point and a goal point. The robot character (an ant) should find its way from the start point (home) to the goal point (food) with minimal costs. The search area has different types of terrains with different cost values, as specified in the following table: Open Terrain Cost-1 Grassland Cost 3 Swampland Cost 4 Obstacles Not applicable Your program must allow the user to specify the grid configuration at the beginning of each run. The user will have to specify the following elements the start and the goal cells the obstacle cells the nature of the terrain for each cell Your program must also allow the user to see visually the path search evolution from the start point to the goal point. Game 2: Finite State Machine (50 marks) The objective of this program is to implement a game simulating the behaviour of ants. The ants should be designed based on the logic that their purpose is to collect food and retum to their home position. The ants have to follow certain obstacles and rules in the simulation: The ants move randomly in their environment in an attempt to locate a piece of food, When an ant finds a piece of food, it returns to its home position. You can implement the path to its home position as you wish. When an ant arrives home, it @) becomes thirsty, (b) drops its food; and (e) starts a search for drinking water. Ants looking for water roam randomly in their environment in their attempt to find water When an ant finds winter, it drinks and then resumes its search for food. New ants are born in the colony. Every time an ant returns food to the home position, a new ant is added (born) to the team that will start a search for food. The ant population continues to grow as long as more food is brought home. The environment is a grilled area with cells that may be of different types empty ground, food, water or poison. Food, water and poison are randomly placed in the environment. Ants can walk safely on empty ground, food and water cells; however, any ant that steps on a polson cell must die The only thing the user has to specify is the starting number of ants in the colony. Food, water and poison should be generated and randomly distributed by the program Ants must be roaming randomly when looking for food or water; otherwise use your creativity to implement other movements (ie, returning to the home position) Game 1: A Pathfinding (50 Marks) The objective of this program is to implement a game with a tiled search area that has obstacles. The search area is a 16 x 16 grid with some obstacles, a start point and a goal point. The robot character (an ant) should find its way from the start point (home) to the goal point (food) with minimal costs. The search area has different types of terrains with different cost values, as specified in the following table: Open Terrain Cost = 1 Grassland Cost = 3 Swampland Cost = 4 Obstacles Not applicable Your program must allow the user to specify the grid configuration at the beginning of each run. The user will have to specify the following elements: o the start and the goal cells o the obstacle cells o the nature of the terrain for each cell Your program must also allow the user to see visually the path search evolution from the start point to the goal point. Game 2: Finite State Machine (50 marks) The objective of this program is to implement a game simulating the behaviour of ants. The ants should be designed based on the logic that their purpose is to collect food and return to their home position. The ants have to follow certain obstacles and rules in the simulation: The ants move randomly in their environment in an attempt to locate a piece of food. When an ant finds a piece of food, it returns to its home position. You can implement the path to its home position as you wish. When an ant arrives home, it (a) becomes thirsty, (b) drops its food; and starts a search for drinking water. Ants looking for water roam randomly in their environment in their attempt to find water. When an ant finds water, it drinks and then resumes its search for food. New ants are born in the colony. Every time an ant returns food to the home position, a new ant is added (born) to the team that will start a search for food. The ant population continues to grow as long as more food is brought home. The environment is a grilled area with cells that may be of different types: empty ground, food, water or poison. Food, water and poison are randomly placed in the environment. Ants can walk safely on empty ground, food and water cells; however, any ant that steps on a poison cell must die. The only thing the user has to specify is the starting number of ants in the colony. Food, water and poison should be generated and randomly distributed by the program. Ants must be roaming randomly when looking for food or water; otherwise, use your creativity to implement other movements (i.e., returning to the home position). o o

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!