1bit-game-jam/scripts/GameCamera.cs
Ivan Kuzmenko f307a7ef00 Add new cool light beam for the flashlight
Co-authored-by: Евгений Титаренко <frundle@teasanctuary.ru>
2023-08-16 00:13:37 +03:00

19 lines
398 B
C#

using Godot;
public partial class GameCamera : Camera2D
{
/// <summary>
/// World position of the flashlight
/// </summary>
public Vector2 FlashlightPosition;
public override void _Input(InputEvent @event)
{
base._Input(@event);
if (@event is InputEventMouseMotion eventMouseMotion)
{
FlashlightPosition = eventMouseMotion.Position - Constants.HalfScreenSize + Position;
}
}
}