New code added

This commit is contained in:
2021-04-05 19:40:57 +02:00
parent a60378bcc0
commit 9391f82df8
6 changed files with 15 additions and 6 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=pygame"
]
}

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,4 @@
"""test"""
import sys import sys
import pygame import pygame
@ -13,8 +14,9 @@ class AlienInvasion:
pygame.init() pygame.init()
self.settings = Settings() self.settings = Settings()
self.screen = pygame.display.set_mode((self.settings.screen_witdh, self.settings.screen_heigh)) self.screen = pygame.display.set_mode(
pygame.display.set.caption("Alien Invasion") (self.settings.screen_witdh, self.settings.screen_heigh))
pygame.display.set_caption("Alien Invasion")
self.ship = Ship(self) self.ship = Ship(self)
@ -39,5 +41,4 @@ class AlienInvasion:
if __name__ == '__main__': if __name__ == '__main__':
# Make a game instance, and run the game.get() # Make a game instance, and run the game.get()
ai = AlienInvasion() ai = AlienInvasion()
ai.run.game() ai.run_game()

View File

@ -1,3 +1,5 @@
"""test"""
class Settings: class Settings:
"""A class to store all settings for alien invasion.""" """A class to store all settings for alien invasion."""

View File

@ -1,3 +1,5 @@
"""test"""
import pygame import pygame
class Ship: class Ship:
@ -18,4 +20,3 @@ class Ship:
def blitme(self): def blitme(self):
"""Draw the ship at its current location""" """Draw the ship at its current location"""
self.screen.blit(self.image, self.rect) self.screen.blit(self.image, self.rect)