Skip to content

Commit

Permalink
Dont reset board on level up
Browse files Browse the repository at this point in the history
  • Loading branch information
samtay committed Nov 17, 2024
1 parent f162487 commit b0c7f6c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Tetris.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,10 @@ initGame lvl = do
, _board = mempty
}

-- | Increment level and reset the board
-- | Increment level
nextLevel :: (MonadIO m, MonadState Game m) => m ()
nextLevel = do
-- Increment level
level %= (+ 1)
-- Reset board
(s1, bag1) <- liftIO $ bagFourTetriminoEach mempty
(s2, bag2) <- liftIO $ bagFourTetriminoEach bag1
block .= initBlock s1
nextShape .= s2
nextShapeBag .= bag2
board .= mempty

isGameOver :: Game -> Bool
isGameOver g = blockStopped g && g ^. (block . origin) == startOrigin
Expand Down

0 comments on commit b0c7f6c

Please sign in to comment.