猫史档案馆


求师傅参加编程猫长隆之旅

用户:『粽小粽』『粽小粽』查看:2 回复:4 评论:2 创建时间:2021-07-03T12:48:49


最好的是大佬的哦。

钉钉号S11088011S


回复

上一页1 页 / 共 1下一页
深流深流

我我我我我我我我我我

点赞0


评论


小小爱html小小爱html

点赞0


评论


淡若天涯心境如水淡若天涯心境如水

我是有实力的

下面是我没完成的

import pgzrun
import random
import math

WIDTH = 450
HEIGHT = 650
score = 0
game_state = 'start'
speed = 6
shoot = False
t = 0

spaceship = Actor('spaceship',(200,550))
diamond = Actor('diamond',(100,-200))
enermy = Actor('enermy2',(300,-200))
bullet = Actor('bullet',(200,-100))


def draw():
    global game_state,shoot,score
    if game_state == 'start':
        screen.blit('space',(0,0))
        screen.draw.text('Spacecraft',(115,260),fontsize = 60)
        screen.draw.text('Press SPACE to start!',(85,320),fontsize = 40)
        if keyboard.space:
            game_state = 'play'
            sounds.bg_music.play(-1)

    elif game_state == 'play':
        screen.blit('space',(0,0))
        screen.draw.text('score:' + str(score),(10,10),fontsize = 30)
        spaceship.draw()
        diamond.draw()
        enermy.draw()
        bullet.draw()

def place_object(obj):
    obj.x = ra

def update():
    global score,game_state,shoot,t
    if game_state == 'play':
        enermy.y += speed - 3
        enermy.x = WIDTH / 2 * ( 1 + math.sin(t))
        t += 0.02
        diamond.y += speed


pgzrun.go

点赞1


评论


『粽小粽』『粽小粽』

em……………………

点赞0


评论