用户:
内向的暴风雀_py5查看:0 回复:0 评论:0 创建时间:2021-09-21T14:29:35
【作品展示】

【作品介绍】
,,,
【作品源代码】
from arcade import *
import random
class My_window(Window):
def __init__(self):
super().__init__(800, 600, '太空遨游')
self.fire = Sprite('fire1.png', scale=1)
self.fire.position = 300, 300
pic = load_texture('fire2.png')
self.fire.append_texture(pic)
self.codemao = Sprite('codemao.png')
self.codemao.position = 400,300
def on_mouse_press(self, x, y, button, modifiers):
self.fire.set_texture(0)
self.fire.change_x = 0
def on_mouse_release(self, x, y, button, modifiers):
self.fire.set_texture(1)
self.fire.change_x = 2
def border(self):
if self.fire.left >= 900:
self.fire.left = 300
def on_draw(self):
start_render()
self.codemao.draw()
self.fire.draw()
def on_update(self, time):
self.fire.update()
self.codemao.update()
self.border()
w = My_window()
run()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn