diff --git a/spaceshooter/__init.py__ b/spaceshooter/__init.py__ new file mode 100644 index 0000000..aee3fa6 --- /dev/null +++ b/spaceshooter/__init.py__ @@ -0,0 +1,6 @@ +## initialize pygame and create window +pygame.init() +pygame.mixer.init() ## For sound +screen = pygame.display.set_mode((WIDTH, HEIGHT)) +pygame.display.set_caption("Space Shooter") +clock = pygame.time.Clock() ## For syncing the FPS diff --git a/spaceshooter/constants.py b/spaceshooter/constants.py new file mode 100644 index 0000000..53d5071 --- /dev/null +++ b/spaceshooter/constants.py @@ -0,0 +1,14 @@ +WIDTH = 480 +HEIGHT = 600 +FPS = 60 +POWERUP_TIME = 5000 +BAR_LENGTH = 100 +BAR_HEIGHT = 10 + +# Define Colors +WHITE = (255, 255, 255) +BLACK = (0, 0, 0) +RED = (255, 0, 0) +GREEN = (0, 255, 0) +BLUE = (0, 0, 255) +YELLOW = (255, 255, 0) diff --git a/spaceshooter/spaceShooter.py b/spaceshooter/spaceShooter.py index 2a3fae2..5e37ae3 100644 --- a/spaceshooter/spaceShooter.py +++ b/spaceshooter/spaceShooter.py @@ -19,28 +19,8 @@ import pygame import random from os import path +from constans import * -## assets folder -img_dir = path.join(path.dirname(__file__), 'assets') -sound_folder = path.join(path.dirname(__file__), 'sounds') - -############################### -## to be placed in "constant.py" later -WIDTH = 480 -HEIGHT = 600 -FPS = 60 -POWERUP_TIME = 5000 -BAR_LENGTH = 100 -BAR_HEIGHT = 10 - -# Define Colors -WHITE = (255, 255, 255) -BLACK = (0, 0, 0) -RED = (255, 0, 0) -GREEN = (0, 255, 0) -BLUE = (0, 0, 255) -YELLOW = (255, 255, 0) -############################### ############################### ## to placed in "__init__.py" later