Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sirtet Game Specification Merijn Bellekom Christiaan Ypma Paul van der Ende.

Similar presentations


Presentation on theme: "Sirtet Game Specification Merijn Bellekom Christiaan Ypma Paul van der Ende."— Presentation transcript:

1 Sirtet Game Specification Merijn Bellekom Christiaan Ypma Paul van der Ende

2 Playing field Playing field, consisting of w columns and h rows – w, h > zero – w, h may not be higher than the output device supports – For normal Tetris: w=10, h=20

3 Definitions Square has – x position (0 <= x < w) – y position (0 <= y) – Stopped flag Shape consists of z Squares joined – 2 < z <= w (or h) and z <7 (z=4 for normal Tetris) – Squares may only be joined on two nodes – Squares snap to playing field grid cells –  Square A, Square B : A != B  A.x != B.x  A.y != B.y (no overlapping)

4 Definitions (2) Shape/Square init – z is random determined – start with one Square with (x=w/2 – z/2, y=h-1) – z- 1 time 1 Square is added to the shape (random(left, right, up)), relative to one already existing Square. Case Left: take existingSquare.x - 1 as x, take existingSquare.y as y … – For every Square Stopped = false

5 Start Game At game start, first Shape is created and appears at screen A start signal is send to Clock, and the Clock triggers ClockTicks every t time

6 Game progress - UserInput UserInput can occur multiple times during a ClockTick UserInput consists of – MoveInput :: MoveLeft | MoveRight | MoveDown – RotateInput :: RotateLeft | RotateRight If moving/rotating a Square within a Shape will violate a constraint, no Square will be changed. MoveInput – MoveLeft  Square q (!q.Stopped  q.x = q.x -1) – MoveRight, MoveDown are similar

7 Game progress - UserInput RotateInput – Determine upmost left corner coordinates x, y, e.g a not stopped square with the lowest x and lowest y. – RotateLeft Rotate every not stopped Square s around 0,0 Move y down and x left s.y = s.x,, s.x = -s.y Move y up and x right – RotateRight 3x RotateLeft

8 Game progress - ClockTick Every clock tick, shape moves down one row on the screen –  Square q : Shape s (!q.Stopped  q.y = q.y -1 ) When a Square s out of a Shape touches bottom of screen or other stopped shape on a full side(s), it stops moving down after the clock tick ends –  Square q, r (q.y == r.y +1  q.x == r.x  !r.stopped  q.stopped  r.stopped) –  Square q (!q.Stopped  q.Stopped = true) The next clock tick, a new shape appears at the top of the screen

9 Game progress - ClockTick When an entire row has been filled with squares from stopped shapes, the line of squares disappears and all squares above it shift down one row 1.Number( q (Square s where (x == ch) )) == w  remove q 2.  Square s (s.y > ch -> s.y = s.y-1) – Multiple rows can disappear in one clock tick, so repeat 1 and 2 until 1 no longer holds

10 Game end Game is over when a Square s stops outside the visual field –  Square A ( A.stopped and A.y == h -> GameEnd) GameEnd means Clock is send a stop signal and terminates, and the game terminates.

11 Game questions


Download ppt "Sirtet Game Specification Merijn Bellekom Christiaan Ypma Paul van der Ende."

Similar presentations


Ads by Google