1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Luba_88 [7]
1 year ago
12

Im trying to do an animation only using simplegui in python and my objective is make the ball enters frame, be confused and jump

to the square in the middle of the room. The problem is that the ball is duplicating and moving its copy instead of moving itself. Here is the code:
import simplegui


x = -100

y = 450

a = 100

b = 450


def draw_handler(canvas):


#back grownd ---------------------------------------------------------------


canvas.draw_polygon([(0,500), (600, 500), (600, 600), (0,600)], 4, "gray", "gray")

canvas.draw_polygon([(200, 477), (400, 477), (400, 500), (200, 500)], 4, "#a6712d", "#a6712d")


#bomb 1

canvas.draw_line((553, 304), (530, 275), 10, "white")

canvas.draw_circle((570,330), 43, 5, "black", "black")


#bomb 2

canvas.draw_line((35, 253), (36, 224), 10, "white")

canvas.draw_circle((33, 298), 43, 5, "black", "black")




#box 1

canvas.draw_polygon([(0, 322), (172, 322), (172, 500), (0, 500)], 20, "#a16c27", "#734810")

canvas.draw_line((172, 322), (0, 500), 20, "#a16c27")


#box 2

canvas.draw_polygon([(476, 374), (600, 374), (600, 500), (476, 500)], 20, "#a16c27", "#734810")

canvas.draw_line((600, 374), (476, 500), 20, "#a16c27")


#character ---------------------------------------------------------------

#x = 300

#y = 400


#canvas.draw_circle((x, y), 80, 10, "#bd80d9", "#a93bdb")

#canvas.draw_polygon([(x+ 30, y - 110), (x-30, y - 110), (x-30, y - 140), (x-15, y-130), (x, y-150), (x+15,y-130), (x+30,y-140)], 3, "#f5bd56", "#f5d356")


#story board 1 ---------------------------------------------------------------


def animation():

x = -100

y = 450


canvas.draw_circle((x, y), 80, 10, "#bd80d9", "#a93bdb")

canvas.draw_polygon([(x+ 30, y - 110), (x-30, y - 110), (x-30, y - 140), (x-15, y-130), (x, y-150), (x+15,y-130), (x+30,y-140)], 3, "#f5bd56", "#f5d356")


#story board 2 ---------------------------------------------------------------


def animation():

global x

global y



x = x+1.5

if(x>100):

x = 100


canvas.draw_circle((x, y), 80, 10, "#bd80d9", "#a93bdb")

canvas.draw_polygon([(x+ 30, y - 110), (x-30, y - 110), (x-30, y - 140), (x-15, y-130), (x, y-150), (x+15,y-130), (x+30,y-140)], 3, "#f5bd56", "#f5d356")


#story board 3 ---------------------------------------------------------------


if(x == 100):

canvas.draw_text("???", (150, 370), 40, "white")


#story board 4 ---------------------------------------------------------------


global a

global b


a = a + 5

b = b - 2.5


if (a > 300):

a = 300

b = 400


canvas.draw_circle((a, b), 80, 10, "#bd80d9", "#a93bdb")

canvas.draw_polygon([(a+ 30, b - 110), (a-30, b - 110), (a-30, b - 140), (a-15, b-130), (a, b-150), (a+15,b-130), (a+30,b-140)], 3, "#f5bd56", "#f5d356")







animation()


frame = simplegui.create_frame('Testing', 600, 600)

frame.set_canvas_background("#363636")

frame.set_draw_handler(draw_handler)

frame.start()


I would really appreciate some help
Computers and Technology
1 answer:
viva [34]1 year ago
5 0
The answer is B = 450 because I just know
You might be interested in
What is a feature of webmail
Fantom [35]

Answer:

Webmail allows the users to access their emails as long as they have access to an Internet connection and a web browser. This also means that the user cannot read an old email or draft a new email offline.

8 0
3 years ago
What is the purpose of using specialized supply chain software?
weeeeeb [17]

Answer:

The purpose of supply chain management is

On the most basic level, the purpose of supply chain management is to make inventory readily available in customer facing positions to fulfill demand. ... Supply chain partners must work together to maximize resource productivity, develop standardized processes, eliminate duplicate efforts, and minimize inventory levels

Explanation:

4 0
2 years ago
What are the inputs that the model uses to make decisions?
hodyreva [135]

Answer:

It makes the decision better and adds ownership in the implementation

Explanation:

Hope this helps C:

~Chiena

8 0
2 years ago
Which of the following is NOT a popular computer programming
cestrela7 [59]
Answer is Xero. All the other Languages are Popular and Widely Used.
Thank You!
6 0
2 years ago
"Bullet Lists" can be which of the following?
MariettaO [177]

Answer:

letters and numbered

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • List three types of cardinalities for relationships within a relational database.
    9·1 answer
  • Is there a way I can put an already made sound that i created over an already made video
    6·1 answer
  • PLEASE HURRY!!!
    11·1 answer
  • A set of connected ideas supported by examples is ?
    7·2 answers
  • Use the drop-down menus to complete the statements about message marking, categorizing, and flagging.
    13·2 answers
  • Match each definition to the correct type of media.
    13·2 answers
  • Which code will print a random number between 1 and 100?
    15·2 answers
  • Can you explain the difference between software and hardware? Tell me 3 examples of each one.
    10·1 answer
  • How many types of operating systems do we have as from 2010 till date​
    13·1 answer
  • 236. A system such as a printer, smart TV, or HVAC controller, typically uses an operating system on what is called a:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!