Tuesday, 05 August 2025 01:43:58
This commit is contained in:
22
Gameplay/Pocket.cs
Normal file
22
Gameplay/Pocket.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Pocket : Area2D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void OnBallPottedEventHandler(Ball BALL, Pocket THIS);
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
||||
BodyEntered += BallPotted;
|
||||
}
|
||||
|
||||
public void BallPotted(Node NODE)
|
||||
{
|
||||
if (NODE is Ball)
|
||||
{
|
||||
EmitSignal(SignalName.OnBallPotted, (Ball)NODE, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user