This commit is contained in:
206530220 2021-06-17 10:45:06 +08:00
parent 4b008d5fd6
commit dbcda72c68
1 changed files with 14 additions and 0 deletions

14
ship2.py Normal file
View File

@ -0,0 +1,14 @@
import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, ai_settings, screen):
"""初始化飞船并设置其初始位置"""
super(Ship, self).__init__()
self.screen = screen
self.ai_settings = ai_settings
self.image = pygame.image.load('images/ship.png')
self.rect = self.image.get_rect()
self.screen_rect = screen.get_rect()