Files
godot-demo-projects/mono/pong/Logic/CeilingFloor.cs
Aaron Franke 006309bd6f Many tweaks thanks to IAmActuallyCthulhu
Also change apostrophes to double quotes and update C# projects
2020-06-28 13:19:13 -04:00

16 lines
306 B
C#

using Godot;
public class CeilingFloor : Area2D
{
[Export]
private int _bounceDirection = 1;
public void OnAreaEntered(Area2D area)
{
if (area is Ball ball)
{
ball.direction = (ball.direction + new Vector2(0, _bounceDirection)).Normalized();
}
}
}