Skip to content

BFUR64/tetrue-lite

Repository files navigation

Tetrue Lite

An open-source Tetris clone for the terminal, built in Java using the Lanterna UI library

Screenshot of Tetrue Gameplay

Demo

Tetrue.Gameplay.mp4

Features

  • Falling Blocks - Standard falling tetrominoes
  • Gravity - Drops move down per second
  • Lock Grace - Allows adjustment before it gets placed
  • Rotation - Rotate blocks clockwise and counterclockwise
  • Movement - Move blocks left and right
  • Hard Drop - Instantly drop a tetromino to the bottom row
  • Scoring - Tracks points for cleared lines
  • Block Queueing (7 Bag System) - Next pieces preview and fair randomization
  • Mobile Friendly Controls - Works on termux

Limitations

  • No game / score tracking after the game is closed
  • No configurable settings
  • Minimal main menu only, featuring New Game, About, and Exit
  • No sound

Environment Issues

  • Designed and tested primarily on Termux (Android)
  • Unix-like environments only (Linux, MacOs)
  • BLOCK_SPARSE (or any gradient based) character renders as dots on Termux, but may appear as gradients or shading on other terminal emulators
  • Windows is not supported

Usage / Controls

  • UP Arrow Key - Hard drop
  • DOWN Arrow Key - Move tetromino down
  • LEFT / RIGHT Arrow Keys - Move tetromino left / right within the grid
  • END Key - Rotate tetromino clockwise
  • HOME Key - Rotate tetromino counter-clockwise

In the main menu, press 0 to exit the application
In the game, press ESC to exit the game

Architecture Overview

Core Loop

Core Loop

Rendering Layer

View Loop

Installation / Running (Unix-like Environments)

Clone the repository

git clone git@github.com:BFUR64/tetrue-lite.git
cd tetrue-lite

Build the shadow JAR

./gradlew shadowJar

Run the generated JAR

java -jar app/build/libs/app-all.jar

Tech Stack

  • Programming Language: Java 21 (Adoptium OpenJDK 21.0.9)
  • Libraries: Lanterna 3.1.3 (Terminal UI)
  • Build Tools: Gradle 9.3.1

Development Environment

Built on Termux Neovim on Android, because I found it more convenient than my laptop (Ability to work on the go). Plus, Lanterna seems to fair well under Unix-like environments unlike Windows, so...

Why I Built This

After 1.5 years of endless architecturing the 'next best' architecture for the project, I realize my honeymoon phase had to end. It doesn't ship. It only promises.

Tetrue Lite is the v7, with all the unnecessary abstractions / over-engineering gutted or removed, with the focus of delivering an MVP, e.g., an actual playable game.

It was a brutal slap in reality when I realized this.

About

An open-source Tetris clone for the terminal, built in Java using the Lanterna UI library

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages