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
Which computer device works like the human central nervous system by connecting all the computer’s parts together and allowing t
frozen [14]
Motherboard. The motherboard is like the brain and heart of the computer, all of the components of the computer hook up to the motherboard.
3 0
3 years ago
What are three sections in a work sheet accounting
slamgirl [31]

Answer:

-The heading of the WorkSheet consists of three parts:-

The name of the business.

-The title

-The period of time (accounting period) for which the worksheet is prepared.

<u>Body</u>

-The body of the WorkSheet contains a big column for the name of accounts and ten money columns or five pairs of money columns, each pair consisting of debit and credit columns.

Explanation:

4 0
3 years ago
Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
aev [14]

Answer:

idk good luck finding one

5 0
3 years ago
What Is the Purpose of a Web Browser? *<br><br>​
Aneli [31]
A web browser takes you anywhere on the internet. It retrieves information from other parts of the web and displays it on your desktop or mobile device. The information is transferred using the Hypertext Transfer Protocol, which defines how text, images and video are transmitted on the web.
6 0
2 years ago
Read 2 more answers
You are reviewing the style sheet code written by a colleague and notice several rules that are enclosed between the /* and */ c
Flauer [41]

Answer:

Nothing will happen.

Explanation:

The rules written between /* and */ will be ignored because /* and */ are the standard way of writing comment in a style sheet code. So, whatever fall in between them will be ignored during rendering of the page.

7 0
3 years ago
Other questions:
  • Add is a function that accepts two int parameters and returns their sum.
    8·1 answer
  • Consider the partially-filled array named a. What does the following loop do? (cin is a Scanner object)int[] a = {1, 3, 7, 0, 0,
    6·1 answer
  • Hello, can you help me answer these questions?
    9·2 answers
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • #11. Write a program that prompts the user to input a four-digit positive integer. The program then outputs the digits of the nu
    6·1 answer
  • which three objects can be linked or embedded in a word document? A. worksheets, margins, colors B. charts, worksheets, images C
    7·1 answer
  • ____ is the dubious practice of registering a domain name and then trying to sell the name for big bucks to the person, company,
    5·2 answers
  • What is the ability for a system to respond to unexpected failures or system crashes as the backup system immediately and automa
    8·1 answer
  • Anyone 13 i a boy 13 pan
    12·2 answers
  • Responsible use of computer is known as ................. .​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!