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

Add boss MVP #200

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/fighters/big_bass/BigBass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/fighters/big_bass/big_bass.fighter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hud:

spritesheet:
image: [BigBass.png]
tile_size: [192, 253]
tile_size: [156, 176]
columns: 15
rows: 3

Expand All @@ -34,7 +34,7 @@ spritesheet:
frames: [0, 3]
repeat: false
attacking:
frames: [16, 23]
frames: [30, 44]

audio:
effects:
Expand Down
18 changes: 7 additions & 11 deletions src/attack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,12 @@ fn enemy_attack(
}

fn boss_attack(
mut query: Query<
(Entity, &mut State, &Handle<FighterMeta>),
(With<Enemy>, With<Target>, With<Boss>),
>,
mut query: Query<(Entity, &mut State), (With<Enemy>, With<Target>, With<Boss>)>,
mut event_reader: EventReader<ArrivedEvent>,

mut commands: Commands,
) {
for event in event_reader.iter() {
if let Ok((entity, mut state, fighter_handle)) = query.get_mut(event.0) {
if let Ok((entity, mut state)) = query.get_mut(event.0) {
if *state != State::Attacking {
if rand::random() && *state != State::Waiting {
state.set(State::Waiting);
Expand All @@ -494,9 +490,9 @@ fn boss_attack(
.insert(Attack { damage: 30 })
.insert(AttackFrames {
//TODO: Check if this is correct
startup: 1,
active: 2,
recovery: 3,
startup: 6,
active: 4,
recovery: 5,
edgarssilva marked this conversation as resolved.
Show resolved Hide resolved
})
.id();

Expand All @@ -508,11 +504,11 @@ fn boss_attack(
}

fn boss_jump_attack(
mut query: Query<(&mut State, &Facing, &Animation, &mut Transform)>,
mut query: Query<(&State, &Facing, &Animation, &mut Transform)>,
time: Res<Time>,
mut start_y: Local<Option<f32>>,
) {
for (mut state, facing, animation, mut transform) in query.iter_mut() {
for (state, facing, animation, mut transform) in query.iter_mut() {
if *state == State::Attacking {
let mut movement = Vec2::ZERO;

Expand Down