猫史档案馆


【Python作品分享】7

用户:幽默的大黄鸡794l幽默的大黄鸡794l查看:0 回复:0 评论:0 创建时间:2022-03-29T12:30:04


【作品展示】

center_image

 

【作品介绍】

这是熙哥,我喵

 

【作品源代码】

import pgzrun
WIDTH=480
HEIGHT=852
background1=Actor('xg')
background1.x=480/2
background1.y=852/2
background2 = Actor('xgg')
background2.x=480/2
background2.y=-852/2
hero = Actor('xixi')
hero.x=WIDTH/2
hero.y=HEIGHT*2/3
bullet=Actor('xixi')
def draw():
    background1.draw()
    background2.draw()
    hero.draw()

def update():
    if background1.y>852/2+852-1:
        background1.y=-852/2
    if background2.y > 852/2+852-1:
        background2.y = -852/2
    background1.y += 1
    background2.y+=1


def on_mouse_move(pos, rel, buttons):
    hero.x=pos[0]
    hero.y=pos[1]
    
pgzrun.go()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页