Tinter interactive animation program

Assignment Help Python Programming
Reference no: EM131265352

Topic: Python - Tkinter

I have a Tinter interactive animation program where I should do a number of specific features. For example, a rotating sticks animation is already set. I have to add the following feature "Pressing "z" teleports a random stick to a random location."

PlanetMoons - Look at the interactive animation program below, then add the following features to it.

1) Even moons are red, odd moons are yellow. Start conting from 0, so the first moon is red. Do not assume there are exactly 3 moons: there could be more or less.

2) A mouse click teleports the planet to the location of the click.

3) "z" makes the last moon 10% faster; "x" makes it 10% slower; "c" inverts its rotation.

4) "a" creates a new moon that is 30 steps further away from the last moon, with initial angle 0 and initial speed 1; "s" deletes the last moon, but the very first moon can never be deleted.

5) "1" turns the planet green; "2" blue; "3" brown. The initial color of the planet is brown.''

6) The planet contains the text "CMU" centered on it.

7) If the mouse click is inside the planet, the planet is not teleported but it turns purple. Otherwise the planet is teleported to the click location.

8) "v" inverts the rotation of all the moons.

9) "r" resets the animation to the initial state.

10) "b" doubles the speed of the slowest moon (be careful with signs: for example, a moon with speed -5.0 is faster than than a moon with speed 2.0. You can use the function abs(x) to get the absolute value of a number x)

11) "n" makes the planet's radius 10 units larger, "m" makes it 10 units smaller. The planet can never become smaller than 10 units.

The distances of all the moons are also increased/decreased of the same amount. Make sure all the functionalities still work properly when the planet is bigger/smaller (like the detection of a click inside the planet).

12) Moons that are slower than 2.0 rad/s (in any direction) turn blue.

13) "d" slows down all the moons by 30%.

14) "f" switches the text inside the planet from "CMU" to "Qatar". Pressing "f" again switches it back to "CMU".

15) Clicking inside a moon makes the planet turn pink (and prevents it from being teleported). Hint: you can find the math formula to calculate the position of the moons in the redrawAll() function.

16) The background of the game is a black starry sky, with 20 stars randomly placed at the beginning of the game. To draw a star, use the provided function drawStar(x, y).

Rotating Sticks - Look at the interactive animation program below, then add the following features to it.

Note: You can assume the canvas is 600x400 pixels.

1) Sticks that rotate clockwise are blue, those that rotate counterclockwise are red.

2) Clicking the mouse makes all the sticks move 10% closer to the location of the click.

3) Pressing "z" teleports a random stick to a random location.

4) pressing "x" creates a new stick in a random location, with a random length between 50 and 150, initial angle 0, and random angular velocity between -5.0 and 5.0. Hint: random.random() returns a float between 0.0 and 1.0.

5) Pressing "c" merges the first two sticks. The resulting stick is located at the middle point between the two original sticks; its length is the average of the two original lengths; its angle and angular velocity are the average of those of the two original sticks. If there are fewer than 2 sticks in the game, "c" has no effect.

6) Pressing "v" aligns all the sticks horizontally to the middle line of the canvas, spaced uniformly. The order of the sticks doesn't matter.

7) Pressing "b" will draw a green closed polygonal line that joins the centers of all the sticks. Pressing "b" again will make it disappear.

SpringFlowers

Explore the interactive animation program below, then add the following features to it:

1) A counter at the top right corner of the screen shows the current number of flowers.

2) Clicking inside the ground creates a new random flower at the location of the click.

Hint: use the function createRandomFlower() (already written for you) and modify the flower that it returns. Then use the function addFlowerInOrder() (also already written for you) to place the new flower in the correct position in the flower list.

3) Pressing "z" makes all the current flowers that are not already withering start to wither. Hint: a flower starts to wither when its age reaches 80% of its lifespan.

4) Pressing "x" makes the smallest flower twice as big. Make sure that your program does not crash if there are no flowers in the game.

5) Pressing "v" deletes all the flowers that are not red or yellow.

6) Every time you press "c" the ground changes color. The color rotates in this order: "tan" -> "green" -> "black" -> "gray" -> "white" -> "tan"

7) Pressing "b" moves all the flowers horizontally 20 units to the right. If a flower falls outside the right margin of the screen (i.e., 800) it appears again at the left margin (i.e., 0).

8) Pressing "n" stops the automatic creation of new flowers; pressing "n" again resumes it.

9) Pressing "a" makes a yellow sun appear on the upper left corner of the screen. Pressing "a" again makes it disappear. The sun is a disc centered at (70, 70) and its radius is randomly selected between 20 and 60 when "a" is pressed.

10) Each flower has a third leaf on the left side. This leaf is attached at 1/3 of the height of the stem, and its size is the average of the size of the other two leaves.

11) Clicking on the sky makes clouds appear at the locations of the clicks. A function that draws one cloud is already written for you (look after redrawAll()).

12) Clicking on the sky makes clouds appear at the locations of the clicks. A function that draws one cloud is already written for you (look after redrawAll()).

13) A counter at the bottom right corner of the screen shows the total number of flowers that ever existed since the beginning of the game.

Attachment:- Assignment.zip

Reference no: EM131265352

Questions Cloud

Messages important in the business world : Why are 30-second messages important in the business world and how might the ability to deliver convincing and meaningful 30-second messaged enhance your career, or a company's performance?
Is it ethical to evaluate managers in the way described : Is it ethical to evaluate managers in the way described? DISCUSS and Explain. Discuss one or more safeguards the company could build into its system to ensure the ethical treatment of employees.
Which method is used in what size of motor : What methods are used in starting squirrelcage induction motor? Which method is used in what size of motor? Which is the most common method and what is its superiority?
Effective-interest method with an effective rate : Teton corporation issued $600,000 of 7% bonds on november 1, 2014, for $644,636. The bonds were dated November 1, 2014, and mature in 10 years, with interest payable each may 1 and November 1. Teton uses the effective-interest method with an effectiv..
Tinter interactive animation program : I have a Tinter interactive animation program where I should do a number of specific features. For example, a rotating sticks animation is already set. I have to add the following feature "Pressing "z" teleports a random stick to a random location..
Factors associated with good time management : What are the five most important factors associated with good time management, and why (be sure to rank)?
Explain how to research a company of your choice : This assignment is designed to teach you how to research a company of your choice. You will be performing an analysis of the financial statements of a publicly traded company.
Find which parameters of circuit model of induction motor : Why is DOL starting current very high but the starting torque is still low? Why DOL is not permitted in starting even though the short duration current cannot harm the motor?
What is cost of inventory : WHAT IS COST OF INVENTORY

Reviews

len1265352

11/4/2016 2:47:15 AM

I have a Tinter interactive animation program where I should do a number of specific features. For example, a rotating sticks animation is already set. I have to add the following feature "Pressing "z" teleports a random stick to a random location." In total, there are two animation programs, one with 7 features to add and the other with 13 features to add. L21 Planet moon is just a solved exercise for reference.

Write a Review

Python Programming Questions & Answers

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

  Implements authentication using needham-schroeder protocol

Write a small project which implements authentication using Needham-Schroeder protocol. Alice connects to Bob using a trusted third party.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Write a program that acts like a simple calculator

You will write a program that acts like a simple calculator for binary numbers. You should read in a string of input that has the format: number operator number.

  Implement a triangle class in python

CSc 11300 Spring 2016 Programming Languages. Implement a Triangle class in Python: The triangle is defined by its three side lengths - a, b, and c. The class includes methods that perform the following operations: is_triangle - checks whether the giv..

  Write a short program in python that turns on all leds

Write a short program in Python that turns on all LEDs, one at a time, in a looping fashion. When an LED is on, it should stay on for 1 second.

  Question 1 research 5-8 species within one family of birds

question 1 research 5-8 species within one family of birds. be sure to use primary or very good secondary literature

  You are tasked with improving the code for the haunted

you are tasked with improving the code for the haunted house game. please read the associated hand-out and the code

  Provide the code for a boolean-valued function

Provide the code for a Boolean-valued function perfect(n)that calculates and returns the Boolean value True or False according to whether the value of the parameter n is a perfect number or not, respectively

  Implement a battleship game in python

Assignment Summary: Battleship is a children's game where players guess (x,y) coordinate positions of the opposing player's ship pieces in a 10x10 grid. For the official Hasbro rules and additional game context, read http://www.hasbro.com/common/i..

  Assignment work in python

Write a function interleave two pictures take the first 20 pixels from the first picture and then 20 pixels from the second picture and then the next 20 pixels from the first picture and then the next 20 pixels from the second picture and so on till ..

  Assignment brief you are tasked with improving the code for

assignment brief you are tasked with improving the code for the haunted house game. please read the associated hand-out

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd