Add new cool light beam for the flashlight
Co-authored-by: Евгений Титаренко <frundle@teasanctuary.ru>
This commit is contained in:
parent
3832a05c1b
commit
f307a7ef00
20 changed files with 230 additions and 68 deletions
19
scripts/GameCamera.cs
Normal file
19
scripts/GameCamera.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue