A small, engine-independent model for a hitmarker UI element. It uses a DecayFloat to drive a one-shot pop animation (scale and fade) and tracks whether the last pop was a kill to choose tint.
using System;
using Goo.Animation;
namespace Goo.FpsUI;
// Hitmarker logic: a one-shot pop (scale + fade) flagged normal or kill. Engine-free.
public sealed class HitmarkerModel
{
DecayFloat _pop = new( 0f, 0.12f ); // 1 on hit, decays to 0
bool _kill; // last pop was a kill
public float Scale => Math.Clamp( _pop.Current, 0f, 1f ); // pop amount for scale + opacity
public bool Kill => _kill; // tint switch (accent vs white)
public void Pop( bool kill ) { _pop.Current = 1f; _kill = kill; } // register a hit
public bool Tick( float dt ) { _pop.Target = 0f; return _pop.Tick( dt ); }
}