Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

play and pause added, show Highscore, Lives of the player improved to 3#29

Open
FEROZLADAKH wants to merge 1 commit into
tasdikrahman:masterfrom
FEROZLADAKH:master
Open

play and pause added, show Highscore, Lives of the player improved to 3#29
FEROZLADAKH wants to merge 1 commit into
tasdikrahman:masterfrom
FEROZLADAKH:master

Conversation

@FEROZLADAKH
Copy link
Copy Markdown

Play /pause added.
HighScore and Restart the game option once all the lives exhaust.
Lives of the player increased by 3.

Copy link
Copy Markdown

@koutoftimer koutoftimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines -444 to -447
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, looks like you have deleted sound effect completely. Explain yourself.

Comment on lines +501 to +502
hits = pygame.sprite.spritecollide(
player, mobs, True, pygame.sprite.collide_circle)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have removed sound effect, why?

Comment on lines +562 to +566
if reset == False:
break
else:
reset = False
continue
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to add some meaning to it, like making running_game_over variable?

Comment on lines +534 to +537
if ev.key == pygame.K_RETURN:
break
elif ev.key == pygame.K_ESCAPE:
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__

or made it match this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants