fix goal state
This commit is contained in:
@@ -38,16 +38,9 @@ void GoalNotReached::_state_exit()
|
||||
|
||||
void GoalNotReached::_on_Goal_body_entered(Node *node)
|
||||
{
|
||||
Godot::print("Flag touched");
|
||||
/* auto parent_node = get_parent();
|
||||
|
||||
if (parent_node != nullptr)
|
||||
{
|
||||
auto goal = Object::cast_to<Area2D>(parent_node);
|
||||
goal->set_collision_mask_bit(0, false);
|
||||
}
|
||||
|
||||
get_state_machine()->change("GoalReached");*/
|
||||
|
||||
get_state_machine()->change("GoalReached");
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "goal/GoalReached.h"
|
||||
#include <Area2D.hpp>
|
||||
|
||||
using namespace godot;
|
||||
|
||||
@@ -6,7 +7,6 @@ void GoalReached::_register_methods()
|
||||
{
|
||||
register_method("_state_enter", &GoalReached::_state_enter);
|
||||
register_method("_state_exit", &GoalReached::_state_exit);
|
||||
//register_signal<GoalReached>("coin_collected", "amount", GODOT_VARIANT_TYPE_INT);
|
||||
}
|
||||
|
||||
GoalReached::GoalReached()
|
||||
@@ -24,6 +24,7 @@ void GoalReached::_init()
|
||||
|
||||
void GoalReached::_state_enter()
|
||||
{
|
||||
Godot::print("Flag touched");
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user