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 python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  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.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  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.

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