
Lv.1
没啥的
签名:没事出一堆水作
在 【技术喵】素材征集,大家有什么想要的素材,但是素材商城又没有的,可以在这里留言哈! 中回复
植物大战僵尸原版,和!!!改改改改改改改改,版!所所所有!
2020-10-02T14:30:36 点赞:0
在 有没有一些好的素材网站(不需要QQ微信等) 中回复
爱给网,花瓣网,或者跑百度找,或搜索X X X图片,或者可以到游戏文件去找,如果有pak文件,用植物大战僵尸3.1修改器解包模式解包到桌面,或者可以购买别人的作品获得素材
2020-10-04T17:25:00 点赞:0
在 【Python作品分享】Hatefulball Pong 2.0【作品秀】 中回复
import pygame as p
import time as t
p.init()
s = p.display.set_mode([800,600])
p.display.set_caption("----- Smiley Pong 2.0 -----")
k = True
BLACK = (0,0,0)
WHITE = (255,255,255)
YELLOW = (255,255,0)
ix = 60
iy = 60
speedx = 1
speedy = 1
pw = 200
ph = 25
px = 300
py = 550
iw = 100
ih = 100
po = 0
l = 5
r = 50
o = 0
ti = 0.01
font = p.font.SysFont("Times",24)
while k:
for event in p.event.get():
if event.type == p.QUIT:
k = False
if event.type == p.KEYDOWN:
if event.key == p.K_F1:
po = 0
l = 5
ix = 60
iy = 60
speedx = 1
speedy = 1
if event.key == p.K_F2:
ti = 0.01
ix += speedx
iy += speedy
if ix <= 50 or ix >= 750:
speedx = -speedx
if iy <= 50:
speedy = -speedy
if iy >= 550:
l -= 1
speedy = -1
speedx = 1
iy = 549
s.fill(BLACK)
p.draw.circle(s,YELLOW,(ix,iy),r)
px = p.mouse.get_pos()[0]
px -= pw/2
p.draw.rect(s, WHITE, (px, py, pw, ph))
ti -= 0.000001
if ti > 0.001:
t.sleep(ti)
else:
t.sleep(0.001)
if iy + ih - 50 >= py and iy + ih - 50 <= py + ph and speedy > 0:
if ix + iw/2 - 50 >= px and ix + iw/2 - 50 <= px + pw:
speedy = -speedy
po += 1
draw_string = "Lives:" + str(l) + " Points: " + str(po) + " Press [F2] to turn the speed to 0.01.(Press [Fn] first)"
if l < 1:
speedx = 0
speedy = 0
draw_string = "...Game Over..."
draw_string += "Your score was: " + str(po)
draw_string += ". Press [F1] to play again. "
text = font.render((draw_string), True, WHITE)
text_rect = text.get_rect()
text_rect.centerx = s.get_rect().centerx
text_rect.y = 10
s.blit(text,text_rect)
p.display.update()
p.quit()2020-10-05T15:15:28 点赞:0