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]
2 years 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]2 years ago
5 0
The answer is B = 450 because I just know
You might be interested in
In the context of the box model, what is the difference between a margin and padding
Andrej [43]

Answer:

It is good to know about the differences between margin and padding .Margin is the outer space of an element, while padding is the inner space of an element. In other words, margin is the space outside of an element's border, while padding is the space inside of its border. You can set auto value to margin.

3 0
3 years ago
What type of computer would integrate the system unit with the display and keyboard?
kolbaska11 [484]
Pc
hope this helps have a good day

3 0
3 years ago
Which of the following is not an Operating System? (1 point)Windows
kobusy [5.1K]
The answers of the following are:

1.  The answer is Linux. It is not an Operating System.
2. Windows XP 2000 and Windows XP Home Edition have the same interface design. 
3. Linux is the operating systems which is considered to be open source.
4. Mac OS is an operating system which is considered to be the most popular with graphic and multimedia designers
5. The software programis the number and variety of programs available for a particular operating system.
4 0
3 years ago
Identify the following keys. write AK for Alphanumeric keypad,NK for Numeric Keypad,CK for Cursor Key, FK for Function keys and
natali 33 [55]

Answer:need points for stuff

Explanation:

4 0
2 years ago
After installing the second hard drive . what two tasks need to be done and what do they do?
Sunny_sXe [5.5K]
Create a partition using the Disk Management program and format the hard drive.

The first point will allow the hard drive to be put to use, and the second point will clear the hard drive completely so it's ready for use. 
3 0
3 years ago
Other questions:
  • The syntax used for referencing cells with their worksheet names is the sheet name, followed by ____, then the usual column lett
    8·1 answer
  • What is computer hacking? describe some examples
    6·1 answer
  • How is the EF​ computed? A. ES​ + Activity time B. LF minusActivity time C. ​Min{LS of all immediate following​ activities} D. ​
    11·1 answer
  • In round-robin scheduling,a) the time quantum should be larger than the context switch time. b) the time quantum should be as sm
    15·1 answer
  • Match the careers with the education required for each job
    5·1 answer
  • The following pseudocode is an example of ____.do stepAdo stepBif conditionC is true thendo stepDelsedo stepEendifwhile conditio
    15·1 answer
  • the default name for the small icon that represents a web site or page, and is displayed in the browsers, typically at the begin
    9·1 answer
  • What is the language of computers?
    9·1 answer
  • The getElementById DOM Method do?
    13·1 answer
  • A computer is the __________ of an attack when it is used to conduct an attack against another computer.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!