mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-05 07:20:07 +01:00
Many tweaks thanks to IAmActuallyCthulhu
Also change apostrophes to double quotes and update C# projects
This commit is contained in:
15
mono/pong/Logic/CeilingFloor.cs
Normal file
15
mono/pong/Logic/CeilingFloor.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user