A Smoll game engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
626 B

using System.Numerics;
using Raylib_cs;
namespace Smoll.Ex2 {
class TimeToLiveComponent : Smoll.Component {
float secondsToLive;
float lived = 0f;
public TimeToLiveComponent(float secondsToLive)
{
this.secondsToLive = secondsToLive;
}
public override void Update(float deltaTimeSeconds)
{
lived += deltaTimeSeconds;
if(lived > secondsToLive) owner.mustDelete = true;
}
public override void Draw(Smoll.Layer.DrawMode drawMode) {
if(drawMode == Layer.DrawMode.Debug) {
}
}
}
}