mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.Timer

Synopsis

Documentation

data Timer Source #

A type that can be used to keep track of time.

Constructors

Timer 

Fields

data Mode Source #

A mode for the Timer. Being set to Repeat will mean the timer loops around once it finishes, while being set to Once will make it stop completely after one finish.

Constructors

Once 
Repeat 

new :: Float -> Mode -> Timer Source #

Create a new Timer specifying its duration in seconds and its mode.

tick :: Float -> Timer -> (Timer, Bool) Source #

Tick a timer by a certain duration. Will return the new state of the timer, as well as a bool signaling whether it has just finished or not.