-
Notifications
You must be signed in to change notification settings - Fork 4
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
Gh 894 power ups #899
Gh 894 power ups #899
Conversation
…rease logic there
apps/arena/lib/arena/game_updater.ex
Outdated
unless Crate.alive?(crate) do | ||
send(self(), {:crate_destroyed, attacking_player.id, crate.id}) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done in multiple places. We should isolate this behavior to update every destroyed crate state in a single pass in only one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I isolated this send behavior inside of the take_damage/3
apps/arena/lib/arena/game/effect.ex
Outdated
Entities.take_damage(entity, real_damage) | ||
|> maybe_send_to_killfeed(pool_owner.id) | ||
if Entities.alive?(entity) do | ||
Entities.take_damage(entity, real_damage, pool_owner.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to move Entities.alive?/1
check to be inside of Entities.take_damage/3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it totally does! i just did it
Motivation
Redesign the way we acquire power ups through the game.
There's an existing bug where you get extra power up from crates if you hit it with two projectiles that will be fixed in #904
Closes #894
Summary of changes
How to test it?
Test the game in this branch and instead of the crates dropping the power ups to the ground you should see your power up number go up
Checklist