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

Boss Bomb Throwing #272

Merged
merged 8 commits into from
Nov 16, 2022
Merged

Boss Bomb Throwing #272

merged 8 commits into from
Nov 16, 2022

Conversation

Zac8668
Copy link
Collaborator

@Zac8668 Zac8668 commented Nov 10, 2022

Implements boss bomb throwing
Closes #269

src/fighter_state.rs Outdated Show resolved Hide resolved
@Zac8668 Zac8668 marked this pull request as ready for review November 13, 2022 20:52
@Zac8668 Zac8668 requested a review from odecay November 13, 2022 20:53
src/metadata.rs Outdated Show resolved Hide resolved
@Zac8668 Zac8668 requested a review from odecay November 14, 2022 23:59
Copy link
Collaborator

@odecay odecay left a comment

Choose a reason for hiding this comment

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

Ok Its looking pretty good I think, might do another pass tomorrow but 👍

src/fighter_state.rs Outdated Show resolved Hide resolved
Comment on lines +1368 to +1370
ItemKind::Bomb { .. } => {
panic!("Can't throw bomb")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be interesting to come back in future and make it so the player can pickup and throw the bomb before it explodes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For sure, I thing the only problem is that the bomb stays "fusing" for I think 0.36 seconds, so not much time to grab and throw it now, but it for sure makes some fun gameplay

Copy link
Collaborator

Choose a reason for hiding this comment

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

yup, I was thinking we could change the duration potentially or have it extend a bit if picked up fast enough.

src/assets.rs Outdated Show resolved Hide resolved
@Zac8668 Zac8668 requested a review from odecay November 15, 2022 16:02
Comment on lines +220 to +227
#[derive(Component, Clone)]
pub struct Explodable {
pub attack: AttackMeta,
pub timer: Timer,
pub fusing: bool,
pub animated_sprite: AnimatedSpriteSheetBundle,
pub explosion_frames: AttackFrames,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does explodable need to have its own AttackMeta and AttackFrames ?
AttackMeta already has its own AttackFrames but couldnt Explodable be a component with only timer and fusing and animated_sprite?
Then add the Explodable component to an entity with an AttackMeta and query for both when you need to deal with both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure about the other thing you said, but we need two attack frames actually, one for the bomb explosion, and one for the frames the boss throws the bombs

src/attack.rs Outdated
Comment on lines 113 to 122
if let Ok((animation, explodable)) = explodable_query.get(**parent) {
if animation.current_frame >= attack_frames.startup
&& animation.current_frame <= attack_frames.active
{
commands.entity(entity).insert(Collider::cuboid(
explodable.attack.hitbox.size.x / 2.,
explodable.attack.hitbox.size.y / 2.,
));
}
}
Copy link
Collaborator

@odecay odecay Nov 16, 2022

Choose a reason for hiding this comment

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

I'd like to avoid special casing this activation code, I've done a bit of a refactor, added the hitbox metadata directly to Attack now which should let you remove this extra query and block if you add a With<Explodable> to the or tuple on the parent_query.

@Zac8668 Zac8668 requested a review from odecay November 16, 2022 19:28
Copy link
Collaborator

@odecay odecay left a comment

Choose a reason for hiding this comment

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

I think its good for now, maybe we can revisit after next release to see if we can simplify anything further

@odecay
Copy link
Collaborator

odecay commented Nov 16, 2022

bors merge

@bors
Copy link
Contributor

bors bot commented Nov 16, 2022

@bors bors bot merged commit f9ee040 into fishfolk:master Nov 16, 2022
@Zac8668 Zac8668 deleted the bomb branch November 17, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement boss bomb throwing
2 participants