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
