A Smoll game engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

24 rindas
626 B

  1. using System.Numerics;
  2. using Raylib_cs;
  3. namespace Smoll.Ex2 {
  4. class TimeToLiveComponent : Smoll.Component {
  5. float secondsToLive;
  6. float lived = 0f;
  7. public TimeToLiveComponent(float secondsToLive)
  8. {
  9. this.secondsToLive = secondsToLive;
  10. }
  11. public override void Update(float deltaTimeSeconds)
  12. {
  13. lived += deltaTimeSeconds;
  14. if(lived > secondsToLive) owner.mustDelete = true;
  15. }
  16. public override void Draw(Smoll.Layer.DrawMode drawMode) {
  17. if(drawMode == Layer.DrawMode.Debug) {
  18. }
  19. }
  20. }
  21. }