用户:
『粽小粽』查看:2 回复:4 评论:2 创建时间:2021-07-03T12:48:49
最好的是大佬的哦。
钉钉号S11088011S
淡若天涯心境如水我是有实力的
下面是我没完成的
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
评论