Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎样改变射击速度? #10

Closed
minkyoyeah opened this issue Jun 1, 2019 · 1 comment
Closed

怎样改变射击速度? #10

minkyoyeah opened this issue Jun 1, 2019 · 1 comment

Comments

@minkyoyeah
Copy link

(original)
if event.type == pygame.MOUSEBUTTONDOWN:
my_bullet = myaircraft.shot()
if my_bullet:
my_bullets_group.add(my_bullet)
(change)
#if event.type == pygame.MOUSEBUTTONDOWN:
my_bullet = myaircraft.shot()
if my_bullet:
my_bullets_group.add(my_bullet)

我从鼠标的点击中删除了子弹,从而改变了我的目标。 我想加快我的拍摄速度,但是我该怎么办呢?

I deleted the shot from the click of the mouse and changed it so that I could shoot while I was still. I want to speed up my shooting, but what code should I change?

@CharlesPikachu
Copy link
Owner

CharlesPikachu commented Jun 3, 2019

如果我没理解错的话,你说的是Game13吧,把utils.py文件里的aircraftSprite类的init_count数值改小一些即可。

class aircraftSprite(pygame.sprite.Sprite):

	def __init__(self, color, bullet_color, **kwargs):

		...
		# 子弹是否在冷却中

		self.is_cooling = False

		self.init_count = 35  --> the value you should adjust

		self.cooling_count = self.init_count
                ...

If I didn't misunderstand your question, the question is about Game13 ?
You could adjust the value of init_count in the class aircraftSprite which defined in utils.py. The smaller, the faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants