CeilingFloor.cs 277 B

12345678910111213141516
  1. using Godot;
  2. using System;
  3. public class CeilingFloor : Area2D
  4. {
  5. [Export]
  6. private int yDirection = 1;
  7. public void OnAreaEntered(Area2D area)
  8. {
  9. if (area is Ball ball)
  10. {
  11. ball.direction += new Vector2(0, yDirection);
  12. }
  13. }
  14. }