Download presentation
Presentation is loading. Please wait.
Published byImogen Shepherd Modified over 8 years ago
1
Oscar de Groot Martijn Nijenhof Ales Sturala Christina Manteli
2
GameBoard: A grid of w(columns) x h(rows) ▪ w,h {1,2,3,..} A collection of cells Cell: Square shaped Cell state can be either Filled or Empty Each cell has a coordinate c(x,y) on the GameBoard c : 0 ≤ c.x ≤ w and 0 ≤ c.y ≤ h
3
Tile: A connected set of Filled cells c 1..n (x,y) on the GameBoard ▪ Tile GameBoard ▪ 4 Rotation states ▪ 2 Shift directions Only one Tile present at any time Content All Filled cells except the Tile
4
Clock tick TryMoveDown RemoveRow User Input TryRotateLeft TryRotateRight TryShiftLeft TryShiftRight
5
A Tile can be rotated Desired: tiles rotate around center of gravity, point symmetric tiles rotated 180° should be in their original positions. ▪ Too complicated. Each tile must have a specified ‘center of rotation’, which is the cell it rotates around. Clockwise (TryRotateRight) or counter clockwise (TryRotateLeft)
6
A Tile can be rotated RotateLeft: Rotate the Tile 90 o counter clockwise around the center of rotation. TryRotateLeft: ▪ RotatedTile = result of the RotateLeft operation ▪ If RotatedTile Content = and RotatedTile GameBoard then RotateLeft(Tile) Same holds for RotateRight and TryRotateRight
7
Tile can be shifted into 3 directions: Left, Right, Down ShiftLeft: c coordinate in Tile: c.x = c.x – 1 TryShiftLeft: ▪ ShiftedTile = result of the ShiftLeft operation ▪ If ShiftedTile Content = and ShiftedTile GameBoard then ShiftLeft(Tile) Same holds for ShiftRight and TryShiftRight
8
MoveDown: c coordinate in Tile: c.y = c.y - 1 TryMoveDown: MovedTile = result of the MoveDown operation if MovedTile Content or MovedTile GameBoard then StuckTile()
9
StuckTile: Content = Content Tile CreateNewTile CreateNewTile: Create new Tile, where Tile GameBoard and Tile Content and Tile.MaxYCoordinate = Gameboard.height | Game over
10
RemoveRows :: Row where every Row.cell==content: remove all content from Row c in Content where c.y > removed Row y- coordinate : c.y = c.y – 1
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.