Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5 Shields #54

Merged
merged 7 commits into from Apr 21, 2022
Merged

5 Shields #54

merged 7 commits into from Apr 21, 2022

Conversation

TorbsT
Copy link
Collaborator

@TorbsT TorbsT commented Apr 18, 2022

Created functionality for shields - each player may create one during the game, and place it in a spot of their choice. It protects against one shot, and once it's destroyed you can't get it back.
Fixes #5

should display and update whenever anyone clicks fire, but doesn't. something wrong with ShieldSystem
@TorbsT TorbsT added the controller/logic Related to logic label Apr 18, 2022
@TorbsT TorbsT added this to the Sprint 4 milestone Apr 18, 2022
@TorbsT TorbsT self-assigned this Apr 18, 2022
Copy link
Collaborator

@Shirajuki Shirajuki left a comment

Choose a reason for hiding this comment

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

Very good job overall! Love the shield sprite btw.
I still have issues with #50 where the states doesn't match each other making it a little bit difficult to test the shield logic so I didn't quite get to see if the shield is being destroyed correctly or not. I did however try my best to give some feedbacks for improvement :)

Hopefully after merging the PR #55 should fix the shooting bug as well.

@@ -6,6 +6,12 @@ import com.badlogic.ashley.core.Component
class ShieldComponent: Component {

var shield = 0
var position = -1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since InputHandler.playerShieldPosition is a thing, you can just use it to draw the shield just like what we've have with the ufos.

If this is however intentional that the shield is planned to still exist after being placed and not shot on that round, as well as that we can trigger/place multiple shields then ignore this :)
(if it is planned like so, then the firebase data needs to be reworked, as the data as of now only allows for 1 shield to be available at a time)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

having a position value in ShieldComponent makes it easier to check position in ShieldSystem without having to check whether the ShieldComponent is left or right, so that's why we've implemented it that way

Copy link
Collaborator

@Shirajuki Shirajuki Apr 21, 2022

Choose a reason for hiding this comment

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

I see, if it is only used for that, then shieldComponent.player would suffice.
It is okay, a small fix / code cleanup in the future can be done. :)

core/src/group16/project/game/ecs/system/ShieldSystem.kt Outdated Show resolved Hide resolved
core/src/group16/project/game/ecs/system/ShieldSystem.kt Outdated Show resolved Hide resolved
core/src/group16/project/game/models/Game.kt Show resolved Hide resolved
core/src/group16/project/game/views/GameScreen.kt Outdated Show resolved Hide resolved
@TorbsT TorbsT requested a review from HeleneAmlie April 21, 2022 17:01
Copy link
Collaborator

@HeleneAmlie HeleneAmlie left a comment

Choose a reason for hiding this comment

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

Looks very good!

@TorbsT
Copy link
Collaborator Author

TorbsT commented Apr 21, 2022

Wow this is a masterpiece... who wrote this??

Copy link
Collaborator

@Shirajuki Shirajuki left a comment

Choose a reason for hiding this comment

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

Tested and everything seems to be working fine! (other than the old #50 bug tho :P)
LGTM!

@HeleneAmlie HeleneAmlie merged commit 9af17bf into master Apr 21, 2022
@HeleneAmlie HeleneAmlie deleted the shields branch April 21, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controller/logic Related to logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create shield sprite
3 participants