Dont reset board on level up
This commit is contained in:
		
							parent
							
								
									f16248734e
								
							
						
					
					
						commit
						b0c7f6c557
					
				
					 1 changed files with 1 additions and 9 deletions
				
			
		|  | @ -175,18 +175,10 @@ initGame lvl = do | ||||||
|     , _board        = mempty |     , _board        = mempty | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| -- | Increment level and reset the board | -- | Increment level | ||||||
| nextLevel :: (MonadIO m, MonadState Game m) => m () | nextLevel :: (MonadIO m, MonadState Game m) => m () | ||||||
| nextLevel = do | nextLevel = do | ||||||
|   -- Increment level |  | ||||||
|   level %= (+ 1) |   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 :: Game -> Bool | ||||||
| isGameOver g = blockStopped g && g ^. (block . origin) == startOrigin | isGameOver g = blockStopped g && g ^. (block . origin) == startOrigin | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Tay
						Sam Tay