不知道为什么没有爆炸效果。
其他图都画得很好,唯独爆炸图不行
explosion = pygame.image.load(os.path.join(image_path, "explosion.png"))
explosion_size = explosion.get_rect().size
explosion_width = explosion_size[0]
for missile_idx, missile_val in enumerate(missiles):
missile_pos_x = missile_val[0]
missile_pos_y = missile_val[1]
#weapon information upgrade
missile_rect = missile.get_rect()
missile_rect.left = missile_pos_x
missile_rect.top = missile_pos_y
if missile_rect.colliderect(rock_rect):
explosion_sound.play()
**explosion_pos_x = missile_pos_x
explosion_pos_y = missile_pos_y
screen.blit(explosion,(explosion_pos_x,explosion_pos_y))**
del(rock)
del(missiles)
missiles = []
# missile position coordination
missiles = [[m[0], m[1] - missile_speed] for m in missiles]
# top missile elimination
missiles = [[m[0], m[1]] for m in missiles if m[1]>0]
森林海
智慧大石
相关分类