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

  Write a program that uses a bar

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  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.

  Evaluate a user''s expression

Write a function that will evaluate a user's expression. It should call the getExpression function that you previously wrote to get the expression to evaluate from the user. You should evaluate the expression step-by-step.

  Python scripting language

Your programming project will be a simple, working program, using a Python scripting language, which utilizes a good design process and includes: Sequential, selection, and repetitive programming statements as well as and At least one function call

  Q1there has been tremendous development in the arid west of

q1there has been tremendous development in the arid west of the united states over the past few decades creating

  You will define an operation on positive integers called

you will define an operation on positive integers called twiddle which consists of summing the squares of the digits of

  Design an application in python

Design an application in Python- The application would generate a set of 100 integers in a random manner in the range of 50 to 150 including both the numbers in the range

  Write a program that generates two integers

Write a program that generates two integers under 100, show them on screen, and prompts the user to enter the sum of these two integers. The program then reports true if the answer is correct, false otherwise.

  1 one factor that leads to a decline in biodiversity is the

1. one factor that leads to a decline in biodiversity is the introduction of non-native species. however most species

  Permutation ciphers

Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.

  Write a python program that generates a small web site

ICT112 Assignment. Your task in this assignment is to write a Python program that generates a small web site to inform Sunshine Coast people about some aspect of the local environment or a local sustainability issue

  Write program that read a text file and prints only odd line

Write a program that reads a text file and prints out only odd lines to the screen. Thus, lines 1, 3, 5,... only printed. Update your odd lines program (Q1) to write odd lines to the screen and write then lines to another file.

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