Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tetriminos

 Tetriminos

A lightweight Tetris clone written in Java as a final project for COSC 1320. This presentation covers the basic program design and two significant algorithms employed.

Maxwell Ciotti

April 28, 2016
Tweet

Other Decks in Programming

Transcript

  1. OVERVIEW o task allocation o uml diagrams o use case

    diagrams o randomization algorithm o rotation algorithm
  2. TASK ALLOCATION BRANDON o layout o theme music o tetriminos

    o randomization o scoring MAXWELL o menus o rotation o hold, next o levels o game over o sound effects
  3. UML CLASS DIAGRAM Tetrimino IShape JShape LShape Oshape SShape TShape

    ZShape Screen GameScreen MenuScreen OptionScreen TopScoreScreen TransitionScreen
  4. UML USE CASE DIAGRAM pause move piece drop piece rotate

    piece move left move right move down GAME PIECE rotate <<uses>> <<extends>> <<extends>> <<extends>>
  5. RANDOMIZATION 0 1 2 3 4 5 6 constructor generate

    queue next piece initialize empty array create piece mapping last 0 1 2 4 6 5 3
  6. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece fill array with unique integers last
  7. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 0
  8. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 4
  9. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 5
  10. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 3
  11. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 6
  12. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 1
  13. RANDOMIZATION 0 2 1 1 2 6 3 3 4

    5 5 4 6 0 constructor generate queue next piece return last element decrement last pointer last return 2
  14. RANDOMIZATION 0 3 1 4 2 1 3 0 4

    5 5 2 6 6 constructor generate queue next piece fill array with unique integers last
  15. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end J-tetrimino
  16. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end central mino index = 1
  17. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end select mino 0
  18. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 1
  19. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 2
  20. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement complete
  21. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end select mino 2
  22. 0 1 3 2 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 1
  23. 0 1 3 2 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 2
  24. 0 1 3 2 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement complete
  25. 0 1 3 2 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end select mino 3
  26. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 1
  27. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement 2
  28. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end mino movement complete
  29. 0 1 2 3 ROTATION begin identify central mino evaluate

    minos: • check rotation path • movement direction • check if occupied end rotation complete
  30. 1 ROTATION square radius 1 gives the direction to move

    next when rotating a mino the center is the central cell in the tetrimino all cells rotate about the central cell as if it were the center of the diagram works clockwise
  31. 1 ROTATION square radius 2 gives the direction to move

    next when rotating a mino the center is the central cell in the tetrimino all cells rotate about the central cell as if it were the center of the diagram works clockwise
  32. 1 ROTATION gives the direction to move next when rotating

    a mino the center is the central cell in the tetrimino all cells rotate about the central cell as if it were the center of the diagram works clockwise movement direction