turtle可移动向后滚动背景_turtle scroll background

"""
  可移动向后滚动背景, 猴小子冲关.py作品的滚动背景。
"""

from turtle import *

screen = Screen()
screen.setup(480,360)
screen.title("猴小子冲关")
screen.bgcolor("blue")
screen.delay(0)
screen.bgpic("隧道.png")

backgrounds =["隧道1.gif","隧道2.gif","隧道3.gif"]
[screen.addshape(bg) for bg in backgrounds]
    
costuems = ['造型1.gif','造型2.gif']
[screen.addshape(c) for c in costuems]
    
bg_index = 0                # 全局背景索引号
currentbg = backgrounds[bg_index]
bg1 = Turtle(shape=currentbg)
bg1.speed(0)
bg1.penup()
 
bg2 = bg1.clone()
alt = 1

You must log in to read the rest of this article. Please log in or register as a user.