Add frame clock

This commit is contained in:
2021-09-09 13:29:09 +01:00
parent a2288110ae
commit be7b2d2cd7
27 changed files with 176 additions and 87 deletions
+14
View File
@@ -0,0 +1,14 @@
module Dodge.Clock
( clockCycle
)
where
import Dodge.Data
import qualified Data.Vector as V
clockCycle :: Int -> V.Vector a -> World -> a
{-# INLINABLE clockCycle #-}
clockCycle tPeriod xs w = xs V.! i
where
l = V.length xs
t = _frameClock w `mod` (l * tPeriod)
i = t `div` tPeriod