擅长:python、mysql、java
<p>用小步移动列表中的每一个外星人。从那以后你从头开始。如果你将在循环(主循环)中重复它,那么看起来就像所有外星人同时移动一样。在</p>
<pre><code># mainloop
while True:
# events
# ....
# updates
for aline in aliens_group:
alien.rect.x += 1 # small move
# or
alien.update() # function have to do small move
# draws
# ...
</code></pre>
<hr/>
<p>顺便说一句:如果外星人有<code>update()</code>的功能,而你将外星人保存在<a href="http://pygame.org/docs/ref/sprite.html#pygame.sprite.Group" rel="nofollow noreferrer">pygame.sprite.Group</a>中,那么你只需要<code>group.update()</code></p>
^{pr2}$