Add new cool light beam for the flashlight

Co-authored-by: Евгений Титаренко <frundle@teasanctuary.ru>
This commit is contained in:
Иван Кузьменко 2023-08-16 00:13:37 +03:00
parent 3832a05c1b
commit f307a7ef00
20 changed files with 230 additions and 68 deletions

19
scripts/GameCamera.cs Normal file
View file

@ -0,0 +1,19 @@
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;
}
}
}