@@ -407,6 +407,7 @@ fn play_cutscene(
407
407
bulls : Query < Entity , With < bull:: Bull > > ,
408
408
// mut ingame_ui_textbox: ResMut<ingame_ui::TextBox>,
409
409
mut audio : GameAudio ,
410
+ text_container : Query < & Children , With < CutsceneTextContainerMarker > > ,
410
411
) {
411
412
let mut camera = camera. single_mut ( ) ;
412
413
// println!("{:?} {:?}", camera.translation, camera.rotation.to_axis_angle());
@@ -619,10 +620,44 @@ fn play_cutscene(
619
620
game_script:: GameScript :: PreLevelOneCutscene => {
620
621
match cutscene_state. cutscene_index {
621
622
0 => {
623
+ cutscene_state. target_camera_translation = Some ( Vec3 :: new ( 6.8157444 , 30.6143255 , -2.526128 ) ) ;
624
+ cutscene_state. target_camera_rotation = None ;
625
+ camera. translation = Vec3 :: new ( 0.0 , 0.0 , 0.0 ) ;
626
+ camera. rotation = Quat :: from_axis_angle ( Vec3 :: new ( -0.051877804 , 0.9947759 , 0.08791898 ) , 2.080009 ) ;
627
+
628
+ cutscene_state. input_cooldown = 0.5 ;
629
+ cutscene_state. waiting_on_input = false ;
630
+ cutscene_state. cutscene_index += 1 ;
631
+ // clear out existing text
632
+ for children in text_container. iter ( ) {
633
+ for entity in children. iter ( ) {
634
+ commands. get_or_spawn ( * entity) . despawn_recursive ( ) ;
635
+ }
636
+ }
637
+ } ,
638
+ 1 => {
622
639
cutscene_state. target_camera_translation = None ;
623
640
cutscene_state. target_camera_rotation = None ;
624
641
camera. translation = Vec3 :: new ( 6.8157444 , 30.6143255 , -2.526128 ) ;
625
642
camera. rotation = Quat :: from_axis_angle ( Vec3 :: new ( -0.051877804 , 0.9947759 , 0.08791898 ) , 2.080009 ) ;
643
+
644
+ for entity in & players {
645
+ println ! ( "setting player animation" ) ;
646
+ let mut animation = animations. get_mut ( entity) . unwrap ( ) ;
647
+ animation. play ( game_assets. matador_run . clone_weak ( ) ) . repeat ( ) ;
648
+ animation. set_speed ( 4.0 ) ;
649
+ }
650
+
651
+ for entity in & bulls {
652
+ println ! ( "setting bull animation" ) ;
653
+ let mut animation = animations. get_mut ( entity) . unwrap ( ) ;
654
+ animation. play ( game_assets. bull_run . clone_weak ( ) ) . repeat ( ) ;
655
+ animation. set_speed ( 3.0 ) ;
656
+ animation. resume ( ) ;
657
+ }
658
+
659
+ cutscene_state. target_camera_translation = Some ( Vec3 :: new ( 6.8157444 , 2.0143255 , -2.526128 ) ) ;
660
+
626
661
audio. stop_bgm ( ) ;
627
662
audio. play_bgm ( & game_assets. pregame_bgm ) ;
628
663
@@ -633,7 +668,7 @@ fn play_cutscene(
633
668
speaking : DisplayCharacter :: Pa ,
634
669
} ) ;
635
670
} ,
636
- 1 => {
671
+ 2 => {
637
672
for entity in & players {
638
673
println ! ( "setting player animation" ) ;
639
674
let mut animation = animations. get_mut ( entity) . unwrap ( ) ;
@@ -658,23 +693,23 @@ fn play_cutscene(
658
693
speaking : DisplayCharacter :: Pa ,
659
694
} ) ;
660
695
} ,
661
- 2 => {
696
+ 3 => {
662
697
textbox. queued_text = Some ( TextBoxText {
663
698
text : "PA: And then... you wreck the place." . to_string ( ) ,
664
699
speed : text_speed,
665
700
auto : false ,
666
701
speaking : DisplayCharacter :: Pa ,
667
702
} ) ;
668
703
} ,
669
- 3 => {
704
+ 4 => {
670
705
textbox. queued_text = Some ( TextBoxText {
671
706
text : "PA: Just destroy all their antiques." . to_string ( ) ,
672
707
speed : text_speed,
673
708
auto : false ,
674
709
speaking : DisplayCharacter :: Pa ,
675
710
} ) ;
676
711
} ,
677
- 4 => {
712
+ 5 => {
678
713
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ,
679
714
CutsceneTexture :: MatTalk ) ;
680
715
textbox. queued_text = Some ( TextBoxText {
@@ -684,31 +719,31 @@ fn play_cutscene(
684
719
speaking : DisplayCharacter :: Mat ,
685
720
} ) ;
686
721
} ,
687
- 5 => {
722
+ 6 => {
688
723
textbox. queued_text = Some ( TextBoxText {
689
724
text : "PA: That's the beauty, kid! You're not doing it, your bull is!" . to_string ( ) ,
690
725
speed : text_speed,
691
726
auto : false ,
692
727
speaking : DisplayCharacter :: Pa ,
693
728
} ) ;
694
729
} ,
695
- 6 => {
730
+ 7 => {
696
731
textbox. queued_text = Some ( TextBoxText {
697
732
text : "PA: It's 100% legal!" . to_string ( ) ,
698
733
speed : text_speed,
699
734
auto : false ,
700
735
speaking : DisplayCharacter :: Pa ,
701
736
} ) ;
702
737
} ,
703
- 7 => {
738
+ 8 => {
704
739
textbox. queued_text = Some ( TextBoxText {
705
740
text : "PA: Anymore questions?" . to_string ( ) ,
706
741
speed : text_speed,
707
742
auto : false ,
708
743
speaking : DisplayCharacter :: Pa ,
709
744
} ) ;
710
745
} ,
711
- 8 => {
746
+ 9 => {
712
747
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ,
713
748
CutsceneTexture :: MatTalk ) ;
714
749
textbox. queued_text = Some ( TextBoxText {
@@ -718,7 +753,7 @@ fn play_cutscene(
718
753
speaking : DisplayCharacter :: Mat ,
719
754
} ) ;
720
755
} ,
721
- 9 => {
756
+ 10 => {
722
757
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ) ;
723
758
textbox. queued_text = Some ( TextBoxText {
724
759
text : "PA: I gave you that earpiece, remember?" . to_string ( ) ,
@@ -727,7 +762,7 @@ fn play_cutscene(
727
762
speaking : DisplayCharacter :: Pa ,
728
763
} ) ;
729
764
} ,
730
- 10 => {
765
+ 11 => {
731
766
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ,
732
767
CutsceneTexture :: MatTalk ) ;
733
768
textbox. queued_text = Some ( TextBoxText {
@@ -737,7 +772,7 @@ fn play_cutscene(
737
772
speaking : DisplayCharacter :: Mat ,
738
773
} ) ;
739
774
} ,
740
- 11 => {
775
+ 12 => {
741
776
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ) ;
742
777
textbox. queued_text = Some ( TextBoxText {
743
778
text : "PA: Nevermind that! You're almost at the first shop." . to_string ( ) ,
@@ -746,7 +781,7 @@ fn play_cutscene(
746
781
speaking : DisplayCharacter :: Pa ,
747
782
} ) ;
748
783
} ,
749
- 12 => {
784
+ 13 => {
750
785
cutscene_texture_state. mat = vec ! ( CutsceneTexture :: MatIdle ) ;
751
786
textbox. queued_text = Some ( TextBoxText {
752
787
text : "PA: Remember, the best offensive is to be offensive!" . to_string ( ) ,
0 commit comments