add a win screen when the flag is reached

This commit is contained in:
2022-08-31 01:07:56 -04:00
parent eb14adbb0e
commit 08216d061c
7 changed files with 183 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
#include "goal/GoalReached.h"
#include "Event.h"
#include <Area2D.hpp>
void alai::GoalReached::_register_methods()
@@ -22,7 +24,8 @@ void alai::GoalReached::_init()
void alai::GoalReached::_state_enter()
{
godot::Godot::print("Flag touched");
auto event = get_node<alai::Event>("/root/Event");
event->emit_signal("player_won");
}
void alai::GoalReached::_state_exit()