godot-demo-projects/mono/pong/Scripts/Wall.cs

14 lines
244 B
C#

using Godot;
public class Wall : Area2D
{
public void OnWallAreaEntered(Area2D area)
{
if (area is Ball ball)
{
// Ball went off the side of the screen, reset it.
ball.Reset();
}
}
}