我已经把图片放进alien_invasion 的images 的 ship.bmp了,但是就是出现不了小飞船图片。
球球大神帮助我这个萌新。
下边是报错的代码
```python
Traceback (most recent call last):
File "C:\Users\bighead\PycharmProjects\pythonProject\alien_invasion\alien_invasion.py", line 22, in <module>
run_game()
File "C:\Users\bighead\PycharmProjects\pythonProject\alien_invasion\alien_invasion.py", line 15, in run_game
ship = Ship(screen)
File "C:\Users\bighead\PycharmProjects\pythonProject\alien_invasion\ship.py", line 9, in __init__
self.image = pygame.image.load('images/ship.bmp')
FileNotFoundError: No such file or directory.
下边是ship.py的代码
```python
import pygame
class Ship:
def __init__(self, screen):
self.screen = screen
self.image = pygame.image.load('images/ship.bmp')
self.rect = self.image.get_rect()
self.screen_rect = screen.get_rect()
self.rect.centerx = self.screen_rect.centerx
self.rect.bottom = self.screen_rect.bottom
def blitme(self):
self.screen.blit(self.image, self.rect)