Skip to content

Standard Tetris in 3D using SDL and OpenGL written in C++

Notifications You must be signed in to change notification settings

matachi/tetris-cpp

Repository files navigation

README

Daniel 'MaTachi' Jonsson

Screenshot

The code is based on the n00b tutorials found on opengl-tutorials.org. Tutorial: OpenGL 3.1 The First Triangle (C++/Win) was also useful.

The development was done on Ubuntu 12.10. The CMake config file hasn't been configured to work on Windows, or even tested on Windows, so with 99.99 % probability it won't compile there.
The shaders are written in GLSL 1.30, so it's runnable on Intel HD3000. It's also confirmed to work with newer/better GPUs, more specifically Nvidia 660.

Directories

  • /common: Contains code from opengl-tutorials.org. However, most of the files are probably unnecessary in this project's context and could be deleted. The original files can be found here.
  • /external: Contains the libraries GLEW, GLM, GLFW and VRAC Cmake Modules. The latter two are probably not needed in this project's context, but were also included from opengl-tutorial.org.
  • /: Files mostly written by myself.

Compile

Install dependencies for compiling: sudo apt-get install cmake build-essential mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxrandr-dev libsdl1.2dev
(Not completely sure if mesa-common-dev actually is needed)

First time configuration: mkdir build ; cd build ; cmake .. ; cd ..

How to compile and run the game: cd build/ ; make ; cd .. ; ./build/Main

Controls

  • Left arrow key: Move block left.
  • Right arrow key: Move block right.
  • Up arrow key: Rotate block.
  • Down arrow key: Move down block instantaneously.
  • Mouse: Change camera direction.
  • W/A/S/D: Move around the camera.
  • E/Q: Increase/Decrease FoV (field of view).
  • Escape: Close the game with the escape key.

Screenshot

About

Standard Tetris in 3D using SDL and OpenGL written in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages