Tetris Game - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Tetris Game

Description:

The game ends when the game has no more room to drop Tetris pieces! Class & Sprite Hierarchy ... TetrisShape: holds an entire Tetris piece. Motion Beans ... – PowerPoint PPT presentation

Number of Views:4258
Avg rating:5.0/5.0
Slides: 9
Provided by: Jam1152
Category:
Tags: game | tetric | tetris | tetrix

less

Transcript and Presenter's Notes

Title: Tetris Game


1
Tetris Game
  • Justin Clay Jamie Haney
  • CS 4491
  • April 30th, 2009

2
About Tetris
  • Tetris is a classic game in which different
    shapes, made up of exactly four blocks, descend
    from the top of the screen. The user must rotate
    and arrange them before they hit the base level.
  • The goal is to create horizontal lines of blocks
    across the screen with no empty spaces!
  • Once filled, lines are removed and points are
    earned.
  • The game ends when the game has no more room to
    drop Tetris pieces!

3
Class Sprite Hierarchy
  • Classes Used
  • Sprites
  • AbsSprite
  • Sprite2D
  • RectSprite holds an individual square
  • TetrisShape holds an entire Tetris piece
  • Motion Beans
  • MoveBean moves a Tetris piece side-to-side
  • MoveDownBean moves a Tetris piece downward
  • RotateBean rotates a piece, given a direction
  • Display
  • Main creates the entire display
  • TetrisGame manages the game itself

4
UML Class Diagram
5
Key Features Functionality
  • Important Display Screens
  • Game Display
  • Pause Display
  • Instructions Display
  • Game Over Display
  • Arrays used to organize game board and Tetris
    shapes. Shapes are created randomly.
  • Coordinates are key!
  • FontMetrics used to properly position display
    text.
  • ActionListeners, KeyListeners, ButtonListeners,
    and ComboListeners are used constantly.

6
Images Sounds
  • 7 shapes
  • I, J, L, O, S, T, and Z.
  • Used fillRoundRect to draw rectangles with a
    small arc, and then drawRoundRect to outline the
    shapes for a more interesting aesthetic.
  • JPanels and BorderLayout used to manage layout.
  • Double buffers used to manage flicker issue.
  • Sound clips taken from Looperman.com, which
    provides free sound loops.

7
Challenges
  • Getting the game board to split up into an exact
    division of evenly-spaced boxes.
  • Determining the coordinates of each of those
    boxes to paint images on the screen.
  • Creating a simple, user-friendly display that was
    both aesthetically pleasing and compact.
  • Determining how exactly to rotate images around
    one axis.

8
Time to see the game!
  • Game split up into 5 steps
  • 1 display a blank application and instructions
    screen
  • 2 draw the 7 shapes anywhere on the screen
  • 3 shapes randomly created dropped down screen
  • 4 add functionality for user to move the piece
  • 5 add functionality for lines to be removed and
    scores to be calculated, added music
  • View the game
  • http//students.kennesaw.edu/jhaney15/cs4491_term
    _project/index.html
Write a Comment
User Comments (0)
About PowerShow.com