Skip to content

Tetris Clone from Gamedev.net. Converted to more Object Oriented code plus added my own features.

Notifications You must be signed in to change notification settings

Mackeul/Tetrisclone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetrisclone

Tetris Clone from Gamedev.net, converted to more Object Oriented code and added my own features. Screenshot

Runtime notes

If running outside of MSVS, make sure to copy the blocks.bmp, tetris.mp3, Pieces.json and Highscores.json into same directory as where .exe is being run from (ie. Debug/Release).

Acknowledgements

Game Features

In addition to the basic game, the following basic features were added:

  • Scoring
  • Highscores read and written to JSON file. (shown via F1).
  • Game Pause (pause key).
  • Tetris music
  • Pieces data read from Pieces.json file (possible to design custom pieces).

C++ Programming concepts used and learned

  • Singleton Pattern for Game object.
  • Observer Pattern for scoring.
  • Simplified State Machine for handling user input for highscores vs regular game input.
  • Bit Blitting for bitmap textures (blocks and text).
  • Collision detection.
  • Implementing 3rd party libraries:
    • spdlog for nice formatting in log output (file or stdout).
    • nlohmann/json for simple and robust JSON reading and writing.
  • Windows Application Programming.
  • MP3 Audio Playback.

About

Tetris Clone from Gamedev.net. Converted to more Object Oriented code plus added my own features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published