mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-07 16:30:06 +01:00
17 lines
277 B
C#
17 lines
277 B
C#
using Godot;
|
|
using System;
|
|
|
|
public class CeilingFloor : Area2D
|
|
{
|
|
[Export]
|
|
private int yDirection = 1;
|
|
|
|
public void OnAreaEntered(Area2D area)
|
|
{
|
|
if (area is Ball ball)
|
|
{
|
|
ball.direction += new Vector2(0, yDirection);
|
|
}
|
|
}
|
|
}
|