SupaLidlGame/Entities/Campfire.cs

25 lines
554 B
C#
Raw Normal View History

2022-12-04 20:12:34 -08:00
using Godot;
using System;
namespace SupaLidlGame.Entities
{
public partial class Campfire : StaticBody2D
{
2023-05-30 01:35:29 -07:00
private PointLight2D _light;
[Signal]
public delegate void OnCampfireUse();
public override void _Ready()
{
_light = GetNode<PointLight2D>("PointLight2D");
}
public override void _Process(double delta)
{
_light.Energy += (GD.Randf() - 0.5f) * 8 * (float)delta;
_light.Energy = Math.Clamp(_light.Energy, 1.2f, 2.0f);
}
2022-12-04 20:12:34 -08:00
}
}