area_entered
is a signal. Signals can be connected to any function. If you use the editor to automatically create a receiving function, it will follow the scheme _on_nodeName_signal_name()
. Otherwise you can create the function like any other C# function and connect the signal to it either via the editor or in code.
public void OnArea2DAreaEntered(Area2D area)
{
// your code here
}
See the Signals tutorial for details.