Adding new code and ship image
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user