Adding new code and ship image

This commit is contained in:
2021-04-05 17:17:24 +02:00
parent 1a914676e6
commit f92e254fc1
3 changed files with 12 additions and 2 deletions

View File

@ -2,14 +2,17 @@ import sys
import pygame
from settings import Settings
class AlienInvasion:
"""Overall class to manage game assets and behaviour."""
def __init__(self):
"""Intialize the game, and create game resources"""
pygame.init()
self.settings = Settings()
self.screen = pygame.display.set_mode((1200, 800))
self.screen = pygame.display.set_mode((self.settings.screen_witdh, self.settings.screen_heigh))
pygame.display.set.caption("Alien Invasion")
# Set the background color.
@ -24,7 +27,7 @@ class AlienInvasion:
sys.exit()
# Redraw the screen during each pass through the loop.
self.screen.fill(self.bg_color)
self.screen.fill(self.settings.bg_color)
# Make the most recently drawn screen visible.
pygame.display.flip()