mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2025-01-19 15:07:21 +01:00
16 lines
306 B
C#
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();
|
||
|
}
|
||
|
}
|
||
|
}
|