mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 01:35:54 +00:00
23 lines
471 B
C#
23 lines
471 B
C#
|
|
using Godot;
|
|||
|
|
|
|||
|
|
namespace Cirno.Scripts.Actors;
|
|||
|
|
|
|||
|
|
public partial class Prism : Area2D
|
|||
|
|
{
|
|||
|
|
[Export] public float ReflectionAngle { get; set; } = 90f;
|
|||
|
|
[Export] public float RotationAngle { get; set; }
|
|||
|
|
|
|||
|
|
public override void _Ready()
|
|||
|
|
{
|
|||
|
|
this.AreaEntered += OnCollision;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void OnCollision(Area2D other)
|
|||
|
|
{
|
|||
|
|
if (other is not Bullet bullet) return;
|
|||
|
|
|
|||
|
|
bullet.RotateBullet(ReflectionAngle);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|