Files
godot-demo-projects/mono/monkey_pong/Wall.cs
Andreas Haas 111c0d4eee Code enhancements for mono pong demo.
- Use pattern matching instead of check-and-cast.
- Rename constants to fit the usual c# code-style.
2017-10-31 14:21:54 +01:00

15 lines
251 B
C#

using Godot;
using System;
public class Wall : Area2D
{
public void OnWallAreaEntered(Area2D area)
{
if (area is Ball ball)
{
// Oops, ball went out of game place, reset
ball.Reset();
}
}
}