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 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()
|
||||||
|
|
||||||
|
|||||||
@ -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."""
|
||||||
|
|
||||||
|
|||||||
3
ship.py
3
ship.py
@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user