Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

bug fix - making player invulnerable as soon as he spawns #18

Merged
merged 8 commits into from
Oct 2, 2020

Conversation

desai10
Copy link
Contributor

@desai10 desai10 commented Oct 2, 2020

This PR fixes #15

@desai10
Copy link
Contributor Author

desai10 commented Oct 2, 2020

@j-tesla so what I have done is tracked when the player spawns. And 1 second after he spawns, he will be flickering to indicate he is invulnerable and during this time he will not take any damage either! Please let me know if this approach is fine with you, also let me know if the invulnerable time has to be changed.

@j-tesla
Copy link
Owner

j-tesla commented Oct 2, 2020

@j-tesla so what I have done is tracked when the player spawns. And 1 second after he spawns, he will be flickering to indicate he is invulnerable and during this time he will not take any damage either! Please let me know if this approach is fine with you, also let me know if the invulnerable time has to be changed.

@desai10 that's almost perfect. One small doubt about the flickering effect implementation: You moved the ship below the screen to hide it in the flickering right? When I shoot when the ship is below the screen the bullets spawn below the screen. I suggest that we make change in the shoot method of the the Player class: Instead of spawning at self.rect.top, we can spawn at a reference height. This solves that issue I guess.
The issue is not at all noticeable in that short time, but I thought may we'll notice it in some future edits.

Also it looks better if we lower the flickering frequency and increase the invulnerability time at least 2 seconds.

@desai10
Copy link
Contributor Author

desai10 commented Oct 2, 2020

Yaa sure, makes sense! I'll add a commit to address these things now.

@desai10
Copy link
Contributor Author

desai10 commented Oct 2, 2020

@j-tesla I added a commit to address those 2 items (flicker interval and bullet spawn position). Please have a look and let me know if this is fine.

@j-tesla
Copy link
Owner

j-tesla commented Oct 2, 2020

@desai10 What I meant about lowering flickering frequency is making it look more like blinking, like in all games. Rest of the changes are perfect.

@desai10
Copy link
Contributor Author

desai10 commented Oct 2, 2020

Sorry, I don't think I understand... So you want the player to fade in and fade out?

@j-tesla
Copy link
Owner

j-tesla commented Oct 2, 2020

@desai10 you didn't get me. 😅 I'll just make a commit.

j-tesla and others added 6 commits October 2, 2020 16:38
Decrease the flickering rate

Signed-off-by: Jayanth PSY <58279279+j-tesla@users.noreply.github.com>
@j-tesla j-tesla merged commit b2df4af into j-tesla:master Oct 2, 2020
@desai10
Copy link
Contributor Author

desai10 commented Oct 2, 2020

ohh sorry!
Thank you! :)

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.

Spaceship is losing health after spawning if there is an asteroid already at the spawn position
3 participants