diff --git a/Graphics/Engine.hs b/Graphics/Engine.hs index 5416a90..3ddab38 100644 --- a/Graphics/Engine.hs +++ b/Graphics/Engine.hs @@ -44,15 +44,15 @@ processEvent = event noEvent $ \case EventMotion {} -> noEvent EventResize size -> Event $ Resize size -run :: forall f. DisplayableSpace f => f Bool -> SF InputEvent Picture -run st = +run :: DisplayableSpace f => (Int, Int) -> f Bool -> SF InputEvent Picture +run size st = let initSpace = gol' standardRule st in proc inp -> do let cmdev = processEvent inp playing <- accumHoldBy (const . not) True -< filterE isPlayPause cmdev time <- accum 0.2 -< mapFilterE getChangeSpeed cmdev - windowSize <- hold (100, 100) -< mapFilterE getResize cmdev + windowSize <- hold size -< mapFilterE getResize cmdev tick <- tickSignal -< time space <- engine initSpace -< gate tick playing diff --git a/Main.hs b/Main.hs index b13cd4c..3888bfc 100644 --- a/Main.hs +++ b/Main.hs @@ -15,4 +15,4 @@ main = (InWindow "Conway's Game of Life" (200, 200) (10, 10)) black 30 - (run space) \ No newline at end of file + (run (200, 200) space) \ No newline at end of file