coin and bgm added, game over music still not done

This commit is contained in:
2022-09-01 15:55:02 -04:00
parent e5d92c8267
commit 7236428157
9 changed files with 69 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
#include "Event.h"
#include <AudioStreamPlayer.hpp>
#include <AnimationPlayer.hpp>
void alai::CoinCollected::_register_methods()
@@ -32,7 +33,8 @@ void alai::CoinCollected::_state_enter()
auto animation_player = Object::cast_to<godot::AnimationPlayer>(node);
animation_player->play("jump");
}
auto coin_collected_sound = get_parent()->get_node<godot::AudioStreamPlayer>("CoinCollectedSound");
coin_collected_sound->play();
}
void alai::CoinCollected::_state_exit()