Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago