New code added
This commit is contained in:
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"python.linting.pylintArgs": [
|
||||
"--extension-pkg-whitelist=pygame"
|
||||
]
|
||||
}
|
||||
BIN
__pycache__/settings.cpython-39.pyc
Normal file
BIN
__pycache__/settings.cpython-39.pyc
Normal file
Binary file not shown.
BIN
__pycache__/ship.cpython-39.pyc
Normal file
BIN
__pycache__/ship.cpython-39.pyc
Normal file
Binary file not shown.
@ -1,3 +1,4 @@
|
||||
"""test"""
|
||||
import sys
|
||||
|
||||
import pygame
|
||||
@ -13,8 +14,9 @@ class AlienInvasion:
|
||||
pygame.init()
|
||||
self.settings = Settings()
|
||||
|
||||
self.screen = pygame.display.set_mode((self.settings.screen_witdh, self.settings.screen_heigh))
|
||||
pygame.display.set.caption("Alien Invasion")
|
||||
self.screen = pygame.display.set_mode(
|
||||
(self.settings.screen_witdh, self.settings.screen_heigh))
|
||||
pygame.display.set_caption("Alien Invasion")
|
||||
|
||||
self.ship = Ship(self)
|
||||
|
||||
@ -39,5 +41,4 @@ class AlienInvasion:
|
||||
if __name__ == '__main__':
|
||||
# Make a game instance, and run the game.get()
|
||||
ai = AlienInvasion()
|
||||
ai.run.game()
|
||||
|
||||
ai.run_game()
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
"""test"""
|
||||
|
||||
class Settings:
|
||||
"""A class to store all settings for alien invasion."""
|
||||
|
||||
@ -6,4 +8,4 @@ class Settings:
|
||||
# Screen settings
|
||||
self.screen_witdh = 1200
|
||||
self.screen_heigh = 800
|
||||
self.bg_color =(230, 230, 230)
|
||||
self.bg_color =(230, 230, 230)
|
||||
|
||||
Reference in New Issue
Block a user