Giter Club home page Giter Club logo

nxtetris's Introduction

NXTetris 🕹ī¸



Cross-platform, over-engineered XTetris written in C

Features

  • Single-player game mode
  • Two-players game mode
  • Player vs. AI game mode (AI algorithm is still really basic)
  • Piece control with keyboard and mouse
  • 2D CLI graphics abstraction
  • Audio output support

Controls

Menu(s)

  • KB_RIGHT - Confirm
  • KB_LEFT - Exit / Back
  • KB_UP, KB_DOWN - Menu navigation

Game

  • KB_LEFT, KB_RIGHT - Rotate the tetromino
  • KB_UP, KB_DOWN - Change tetromino
  • MOUSE_X - Position the tetromino in the x-axis
  • MOUSE_LEFT - Drop the current tetromino in the board

Build

Requirements:

  • cmake
  • make
  • pkg-config (macOS/Linux only)

Building the program is done by running the following commands:

git clone --recursive https://github.com/sonodima/nxtetris
cd nxtetris

mkdir -p build/release
cd build/release

cmake ../.. -DCMAKE_BUILD_TYPE=Release
make

The output executable will be named nxtetris and will be placed in build/release.

NOTE: The binary needs to be shipped with the resources folder (which is copied to the build directory at compile time) in order to work properly. (without it the audio won't play)

Windows Compilation

Due to ncurses limitations, on Windows MinGW is required to compile the program.
You can use the following command to generate the Makefile for MinGW:

cmake ../.. -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"

Libraries

  • ncurses: terminal control library, enabling the construction of text user interface (TUI) applications.
  • portaudio: cross-platform audio I/O library.
  • libsndfile: audio file I/O library.

All the libraries are managed by vcpkg and are automatically obtained during the build process.

NOTE: The first build will take a while since all the libraries need to be downloaded and built.

nxtetris's People

Contributors

sonodima avatar

Watchers

 avatar

nxtetris's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.