Termi-Jump is a small, playable platform-jumping game that runs directly in a terminal. It is built with Java 17 and has no external library dependencies.
Steer the character from platform to platform, climb as high as you can, and try to beat your best score. This repository includes the Java source code, build and test scripts, and GitHub Actions workflows for continuous integration and tagged releases.
Play the Game
Requirements
- Java 17 or newer
- A Unix-like system and an interactive terminal
Start
From the repository directory, run:
./run.sh
The script compiles the Java source and launches the game. It creates the
runnable JAR at build/termijump-1.0.0.jar.
Controls
- Move left:
Aor Left Arrow - Move right:
Dor Right Arrow - Restart after a game over:
R - Quit:
QorEsc
How Gameplay Works
The character jumps automatically after landing, so focus on steering rather than timing a jump button. Move across each platform to land on the next one. Platforms are generated as you climb; they become narrower and harder to reach at greater heights.
The view scrolls upward as you rise. Your height records the highest point you reach, and your score is 10 points for each height unit. Falling below the play area ends the run. Your best score is kept for the current game session; it resets when you close the game.
Run the Tests
Run the test suite with:
./test.sh
The script compiles the application and tests with Java 17, then runs the tests with assertions enabled. No separate test framework or dependency installation is required.
How the Code Is Organized
Java source files are in src/main/java/com/termijump/; tests are in
src/test/java/com/termijump/.
Main.javastarts the game and ensures terminal resources are closed.Game.javaruns the frame loop and coordinates player updates, platforms, camera scrolling, scoring, and game states.Player.javaimplements horizontal movement, gravity, and automatic bouncing on platforms.Platform.javamodels a platform;PlatformGenerator.javacreates the starting platform and generates the next platforms as the player climbs.InputHandler.javareads keyboard input and restores terminal settings when the game exits;InputSource.javadefines the input interface.TerminalRenderer.javadraws the game, controls, and score in the terminal.ScoreTracker.javatracks height, score, and the session's best score.GameState.javarepresents the current state of the game.GameTest.javacontains the game's tests.
Build and Automation
build.sh compiles the source with the Java 17 language/API target and packages
it as a runnable JAR. test.sh compiles and runs the tests without requiring
an external build tool.
GitHub Actions runs the tests and builds the JAR for pushes and pull requests.
Pushing a version tag in the form v* triggers the release workflow, which
publishes the runnable JAR as a GitHub Release asset.
