用户:
Little_Race查看:0 回复:0 评论:0 创建时间:2021-10-09T22:02:32
【作品展示】

【作品介绍】
用比较复杂的方法画小车,针不戳,有海龟我不用,哎,就是玩
【作品源代码】
from arcade import *
# 设置窗体宽和高
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
# 设置窗体标题
SCREEN_TITLE = "哑铃"
class MyDraw(arcade.Window):
def __init__(self, width, height, title):
super().__init__(width, height, title)
# 窗体初始化
self.setup()
def setup(self):
# 设置背景颜色
set_background_color(color.WHITE)
def on_draw(self):
start_render()
self.mydraw()
def mydraw(self):
bx, by = 400, 300
# 中间
draw_rectangle_filled(bx, by, 300, 30, color.SKY_BLUE)
# 左边
draw_rectangle_filled(bx - 150 + 50, by, 50, 100, color.BLUE)
# 右边
draw_rectangle_filled(bx + 150 - 50, by, 50, 100, color.BLUE)
# 署名
draw_text("--by 阿短", bx + 150, by - 100, color.BLUE, font_name=("simhei", "PingFang"), )
if __name__ == "__main__":
game = MyDraw(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
run()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn