play and pause added, show Highscore, Lives of the player improved to 3#29
play and pause added, show Highscore, Lives of the player improved to 3#29FEROZLADAKH wants to merge 1 commit intotasdikrahman:masterfrom
Conversation
koutoftimer
left a comment
There was a problem hiding this comment.
This pull request required A LOT of changes to be made.
| ## group all the sprites together for ease of update | ||
|
|
||
| # group all the sprites together for ease of update |
There was a problem hiding this comment.
I understand your intentions, but it is not good to look at all those not sufficient changed during code review. Maybe it needs to be done in separate commit?
| pygame.mixer.music.stop() | ||
| #Play the gameplay music | ||
| pygame.mixer.music.load(path.join(sound_folder, 'tgfcoder-FrozenJam-SeamlessLoop.ogg')) | ||
| pygame.mixer.music.play(-1) ## makes the gameplay sound in an endless loop |
There was a problem hiding this comment.
Have you refactored this code somehow or it have been deleted completely? If it was refactored then show where, if deleted - explain why.
| ## as there will be no mob_elements left out | ||
| for hit in hits: | ||
| score += 50 - hit.radius ## give different scores for hitting big and small metoers | ||
| random.choice(expl_sounds).play() |
There was a problem hiding this comment.
Again, looks like you have deleted sound effect completely. Explain yourself.
| hits = pygame.sprite.spritecollide( | ||
| player, mobs, True, pygame.sprite.collide_circle) |
There was a problem hiding this comment.
In general, do not refactor the code if you aren't changing anything. You are committing logic changes, not PEP8 refactoring.
| all_sprites.add(expl) | ||
| newmob() | ||
| if player.shield <= 0: | ||
| player_die_sound.play() |
There was a problem hiding this comment.
You have removed sound effect, why?
| if reset == False: | ||
| break | ||
| else: | ||
| reset = False | ||
| continue |
There was a problem hiding this comment.
You are using reset to quit "main" loop controlled by variable running, why not just use it instead?
| screen.fill(BLACK) | ||
| screen.blit(background, background_rect) | ||
| pygame.display.update() | ||
| while True: |
There was a problem hiding this comment.
Would you like to add some meaning to it, like making running_game_over variable?
| if ev.key == pygame.K_RETURN: | ||
| break | ||
| elif ev.key == pygame.K_ESCAPE: | ||
| break |
There was a problem hiding this comment.
This can be grouped up
if env.key in [pygame.K_RETURN, pygame.K_ESCAPE]:| break | ||
| elif ev.key == pygame.K_r: | ||
| reset = True | ||
| player.lives = 5 |
There was a problem hiding this comment.
Your commit message says
improved to 3
but I see 5. How is that?
Also, you haven't changed initial/default value in Player.__init__
spaceShooter/spaceshooter/spaceShooter.py
Line 169 in 1867d77
or made it match this one.
Play /pause added.
HighScore and Restart the game option once all the lives exhaust.
Lives of the player increased by 3.