python海龟画图模块画布弹球程序

"""python海龟画图模块画布弹球程序"""

from turtle import *
from random import randint
from time import sleep

width,height=480,360

screen = Screen()
screen.bgcolor("navy")
screen.title("python海龟画图模块画布弹球程序by lixingqiu")
screen.setup(width,height)
canvas = screen.cv                                    # 获取画布
canvas.create_line(0, 0, 90, 90, fill="red", width=3) # 这条线看出坐标系
ball = canvas.create_oval(0,0,50,50,fill='cyan')      # 创建圆形,返回的是编号

xspeed = randint(-5,5)                                # 设定x速度
yspeed = randint(-5,5)                                # 设定y速度

本文隐藏内容 登陆 后才可以浏览

python海龟画图模块画布弹球程序lixingqiu