You will write the complete model module, and a variety of classes derived from the base classes by inheritance. You will also use the names controller.the_canvas and controller.the_progress to update what is in the view. The former starts with a width 500 pixels and height 300 pixels.
When you define these classes, don't any code written in their base classes. Also don't access by name or duplicate an instance variables (attributes) that are inherited. You can call methods in the bases classes to access/update their instance variables and override any methods in the base clases (whose bodies might call the overridden methods to help them accomplish their task). You can also define new methods. Each leaf class must define or inherit an update and display method, which respectively implement the behavior of objects in that class and the image that they display on the canvas.
Finally, you must develop one more class, named Special that appears somewhere in this hierarchy, and exhibits interesting behavior.
Write the Ball class: each Ball is blue, has radius 5, moves at 5 pixels/second, and starts moving at a random angle.
Write the world, reset, start, stop, step, select_object, mouse_click, add, remove, find, update_all, and display_all functions, most of which can be tested using only Ball objects. The step button stops the simulation after executing one cycle: if it is running, it stops after one more cycle: if it is stopped it starts for one cycle and then stops again.
Write, test, and debug the Black_Hole class. Ensure the user can add Black_Holes to the simulation. Each Black_Hole is black and has a radius of 10. Override the contains method so that a point is contained in the Black_Hole if the distance from the center of the Black_Hole to the center of the object is less than the radius of the Black_Hole. Use the find method in the model module to locate all objects that are instances of Prey (or any of its subclasses no matter how many are added later) and whose locations are contained in the circle representing the Black_Hole. The update method should return the set of simultons eaten: this information will be useful when inherited from the Pulsator class.
Write, test, and debug the Pulsator class. Ensure the user can add Pulsators to the simulation. Each Pulsator behaves and initially looks like a Black_Hole, except for the following additional behavior. For every object a Pulsator eats, its dimension grows by 1 and its "time between meals" counter is reset; whenever it is goes 30 updates without eating anything, its dimension (both width and length) shrinks by 1; and if the dimensions ever shrink to 0, the object starves and removes itself from the simulation. The update method should still return the set of simultons eaten.
Write, test, and debug the Hunter class. Ensure the user can add Hunters to the simulation. Each Hunter behaves and initially looks like a Pulsator, except for the following additional behavior. A Hunter always moves at 5 pixels/second, and intially is moving at a random angle. Use the find method in the model module to locate all objects that are instance of Prey (or any of its subclasses no matter how many are added later) and whose locations are within a distance of 200 of the Hunter; if any are seen, find the closest one and set the hunter's angle to point at that simulton: to hunt it.
Write, test, and debug the Special class. Ensure the user can add Specials to the simulation. Make the Special objects do something interesting; write a comment at the top of the [url removed, login to view] module that describes their behavior and watch that behavior when running a simulation.
Write, test, and debug the Floater class, which is similar to the Ball class, with two important differences: they are displayed as images (a UFO icon) and they move in a strange way. Ensure the user can add Floaters to the simulation. Initially, each Floater moves at 5 pixels/second, and is moving at a random angle.
6 freelancere byder i gennemsnit $127 på dette job
Hello I am a python developer of over 10 years and believe my experience developing python games may be of use to you after reading your requirements, please message me if you are interested.
Dear sir, your project spec is not totally clear to me. can you please specify it little briefly so that it is understandable to every one. Thanks Saikat
Trust an American to work for you. I'll spend time thinking about your project with good implementation, instead of the shortest amount of time just for money. Thanks.