-
Notifications
You must be signed in to change notification settings - Fork 69
Improve the API #4
Comments
Do you want to use FRP.Elerea.Param to distribute the time deltas over the signals? getTicks :: SignalGen (Signal Int)
getTicks = effectful $ fromIntegral <$> SDL.getTicks
getDT :: SignalGen (Signal Int)
getDT = getTicks >>= \t -> (fmap . fmap) snd $ (transfer (0,0) (\t (lastT,lastDT) -> (t,t-lastT)) t ) edit: main = run $ do
dt <- getDT
b <- booleanSignalGen
if b --just pretent its Bool istead of Signal Bool, because I'm too lazy.
then
return $ dummy <$> dt --dt is sampled correctly
else
return $ return $ dummy 0 --dt is not sampled now, lastT won't be updated, next dt will be wrong.
dummy :: a -> Element
dummy a = collage 600 800 [] Should we do something about that? I think it would be more reliable to calculate the time in the run' function and then distribute it with FRP.Elerea.Param. |
Looks good. I'll take a look tomorrow. |
Sorry if I'm misinterpreting, but only having it work if it's sampled every frame is kind of the functionality I was hoping for. It's going to be called |
Oh I didn't think about that! Its not a bug its a feature! Yeah sure. Giving control over what kind of deltas one can get is awesome. I also like the idea of an generic delta function. Not just for time. |
@veryrandomname there's a prototype of a Time module now, with a |
Frame rate handling and basic animations are now supported. See #11 about the audio API. |
This is a general bug to organize efforts in the following areas:
Timer and frame rate deltasAnimation support or examples for itThe text was updated successfully, but these errors were encountered: