Question: I need help writing a program in python. it a clone from a game called classic flock simulator boids. 2 Implementation The simulator should simulate

I need help writing a program in python. it a clone from a game called classic flock simulator boids.

I need help writing a program in python. it a clone from

a game called classic flock simulator boids. 2 Implementation The simulator should

simulate a moving flock consisting of boids operating by a set of

2 Implementation The simulator should simulate a moving flock consisting of boids operating by a set of rules. The goal is to make the flock move in a lifelike manner, without hard-coding the movement. Each boid has a set of adjacent boids, and should follow these rules: 1. Boids steer towards the average position of local flockmates. 2. Boids attempt to avoid crashing into other boids. 3. Boids steer towards the average heading of local flockmates. The simulator should also include some additional features: Obstacles the boids need to avoid. Predators (hoiks) that will try to eat the boids. The appearance of the simulator is up to you. The visual elements can be represented by sprites (images) or by simple shapes like circles or rectangles. The number of boids is also optional, however the size of the flock should allow it to split into several smaller flocks. 2.1 Requirements 1. Implement the simulator in accordance with object-oriented design, using objects and classes. 2. Inheritance must be used to implement at least one class. 3. The simulator must follow the rules described above. 4. Hoiks and obstacles must be implemented. 5. The report must give a description of inheritance in object-oriented pro- gramming, and how you have chosen to use this feature. 6. The hand-in must include a class diagram (as shown in lectures) which describes relations between the different classes. 2.3 Hints Make sure that the boids always keep a steady speed, preventing them from halting, or speeding off the screen. Write the code so that the significance of each rule can easily be modified. You should experiment with these, in order to maintain a life-like flock movement. 2 Implementation The simulator should simulate a moving flock consisting of boids operating by a set of rules. The goal is to make the flock move in a lifelike manner, without hard-coding the movement. Each boid has a set of adjacent boids, and should follow these rules: 1. Boids steer towards the average position of local flockmates. 2. Boids attempt to avoid crashing into other boids. 3. Boids steer towards the average heading of local flockmates. The simulator should also include some additional features: Obstacles the boids need to avoid. Predators (hoiks) that will try to eat the boids. The appearance of the simulator is up to you. The visual elements can be represented by sprites (images) or by simple shapes like circles or rectangles. The number of boids is also optional, however the size of the flock should allow it to split into several smaller flocks. 2.1 Requirements 1. Implement the simulator in accordance with object-oriented design, using objects and classes. 2. Inheritance must be used to implement at least one class. 3. The simulator must follow the rules described above. 4. Hoiks and obstacles must be implemented. 5. The report must give a description of inheritance in object-oriented pro- gramming, and how you have chosen to use this feature. 6. The hand-in must include a class diagram (as shown in lectures) which describes relations between the different classes. 2.3 Hints Make sure that the boids always keep a steady speed, preventing them from halting, or speeding off the screen. Write the code so that the significance of each rule can easily be modified. You should experiment with these, in order to maintain a life-like flock movement

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!