Adding ship and settings

This commit is contained in:
2021-04-05 19:20:09 +02:00
parent f92e254fc1
commit a60378bcc0
2 changed files with 25 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import sys
import pygame
from settings import Settings
from ship import Ship
class AlienInvasion:
"""Overall class to manage game assets and behaviour."""
@ -15,6 +16,8 @@ class AlienInvasion:
self.screen = pygame.display.set_mode((self.settings.screen_witdh, self.settings.screen_heigh))
pygame.display.set.caption("Alien Invasion")
self.ship = Ship(self)
# Set the background color.
self.bg_color = (230, 230, 230)
@ -28,6 +31,7 @@ class AlienInvasion:
# Redraw the screen during each pass through the loop.
self.screen.fill(self.settings.bg_color)
self.ship.blitme()
# Make the most recently drawn screen visible.
pygame.display.flip()