0

Can't append class object to list

#imports from random import randint import turtle import math #setting screen size WIDTH = 500 HEIGHT = 600 SPEED = 8 #set up window wn = turtle.Screen() wn.title("wild chaos") wn.bgcolor("green") wn.setup(WIDTH,HEIGHT) images = ["mouse(level2).gif","rabbit(level4).gif","chicken(level8).gif","pig(level16).gif","deer(level32).gif","fox(level64).gif","donkey(level128).gif","cobra(256).gif","cheetah(level512).gif","tiger(1024).gif","lion(2048).gif"] for i in images: wn.addshape(i) wn.tracer(0) #static elements pen_static = turtle.Turtle() pen_static.hideturtle() pen_static.pencolor("black") pen_static.penup() #title box pen_static.goto(-230,280) pen_static.pendown() pen_static.color("black","white") pen_static.pensize(3) pen_static.begin_fill() pen_static.goto(-30,280) pen_static.goto(-30,220) pen_static.goto(-230,220) pen_static.goto(-230,280) pen_static.end_fill() pen_static.penup() pen_static.goto(-130,245) pen_static.write("Wild Chaos", False, align="center",font=("source code pro black",15,"bold")) #score box pen_static.goto(-230,-280) pen_static.pendown() pen_static.begin_fill() pen_static.goto(-230,-220) pen_static.goto(-90,-220) pen_static.goto(-90,-280) pen_static.goto(-230,-280) pen_static.end_fill() pen_static.penup() pen_static.goto(-160,-245) pen_static.write("Score :", False, align="center",font=("source code pro black",12,"bold")) #highest level box pen_static.goto(-70,-280) pen_static.pendown() pen_static.begin_fill() pen_static.goto(-70,-220) pen_static.goto(70,-220) pen_static.goto(70,-280) pen_static.goto(-70,-280) pen_static.end_fill() pen_static.penup() pen_static.goto(0,-245) pen_static.write("Highest Score :", False, align="center",font=("source code pro black",10,"bold")) #stage box pen_static.goto(90,-280) pen_static.pendown() pen_static.begin_fill() pen_static.goto(90,-280) pen_static.goto(90,-220) pen_static.goto(230,-220) pen_static.goto(230,-280) pen_static.goto(90,-280) pen_static.end

31st May 2022, 12:52 PM
Eren Ozer
1 ответ
+ 3
Save this code as public in Code Playground, then edit your question and change the wall of code for a link to the code in Code Playground. This is better to test and debug. Then, use question description to explain the problem. Which class, which list, which line, which error? Also, change the tag to the language name. This is important for future searches.
31st May 2022, 1:01 PM
Emerson Prado
Emerson Prado - avatar