
Lv.1
404 not found
签名:印象派全套 我的人生(模拟赚钱) 小说《命悬一线》
在 求师傅参加编程猫长隆之旅 中回复
我是有实力的
下面是我没完成的
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.go2021-07-03T22:12:48 点赞:1