0
点赞
收藏
分享

微信扫一扫

python遍历子弹数组 改变子弹坐标 超出界面移除

晚熟的猫 2022-01-21 阅读 69
class zidan:
	def __init__(self):
		self.x = self
		self.y = self
		self.width = self
		self.height = self
		self.color = self
		self.screen=self
	def up():
		pygame.draw.rect(self.screen, (0,144,0), (self.x, self.y+34, self.width, self.height+20), 0)#(0, 144, 662, 55), 0)
li=[]
c=zidan()
c.x=0
c.y=0
li.append(c)
while True:
	for c in li:
		c.y+c.y+2
		c.up
		if c.y>600:
			li.remove(c)
举报

相关推荐

0 条评论