diff --git a/README.md b/README.md index 099f492..a066f39 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A space shooter game created using [Pygame](https://www.pygame.org/). The main o For windows users, you can download the setup file [here]() or look at the latest [release](https://github.com/anarghya-das/Space-Invader/releases). Install the game and go to the folder where you installed it and run **main.exe**. -For Linux and Mac users, make sure you have python3 and pygame install (see contribution for more details). Clone or download this repository as a zip file and then run the main.py file. +For Linux and Mac users, make sure you have python3 and pygame install (see contribution for more details). Clone or download this repository as a zip file and then run the main.py file. ## Game Instructions @@ -16,4 +16,4 @@ Basic game controls: - **Movement:** Move your spaceship using the right or left arrow keys. - **Laser:** Use spacebar to shoot laser towards your enemies. -- **General:** Press escape to pause the game and enter to resume the game. +- **General:** Press escape to pause the game and enter to resume the game. diff --git a/main.py b/main.py index 648ddcf..28fbad5 100644 --- a/main.py +++ b/main.py @@ -11,17 +11,21 @@ def show_score(score): screen.blit(s, (scoreX, scoreY)) -def show_over(): +def show_over(score): over = pygame.font.Font('freesansbold.ttf', 82) mediumText = pygame.font.Font('freesansbold.ttf', 42) s, end = text_objects("Game Over!", over, WHITE) end.center = (math.floor(SCREEN_WIDTH/2), math.floor(SCREEN_HEIGHT/2)) + score, srect = text_objects(f"Final Score: {score}", mediumText, WHITE) + srect.center = (math.floor(SCREEN_WIDTH/2), + math.floor(SCREEN_HEIGHT/2)+70) enter, rect = text_objects( "Press Enter to Restart", mediumText, WHITE) rect.center = (math.floor(SCREEN_WIDTH/2), - math.floor(SCREEN_HEIGHT/2)+70) + math.floor(SCREEN_HEIGHT/2)+120) screen.blit(s, end) + screen.blit(score, srect) screen.blit(enter, rect) @@ -149,7 +153,7 @@ def game(playerX_change_value, enemyX_change_value, enemyY_change, enemy_count, screen.blit(background, (0, 0)) if game_over: pygame.mixer.music.stop() - show_over() + show_over(score) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False @@ -294,7 +298,7 @@ def main(): pygame.display.set_caption("Space Invaders") # Difficulty Values which can be modified to increase or decrease the game difficulty - difficulty_step = 10 # After every 10 points scored the difficulty increases + difficulty_step = 10 # After every 10 points scored the difficulty increases bullet_speed = 5 playerX_change_value = 5 enemyX_change_value = 5 diff --git a/setup.py b/setup.py index f1cc57e..5f9243b 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,6 @@ cx_Freeze.setup( name="Space Invader", options={"build_exe": {"packages": ["pygame"], - "include_files": ["back.jpg", "bullet.png", "enemy.png", "player.png"]}}, + "include_files": ["assests/"]}}, executables=executables )