GithubHelp home page GithubHelp logo

java-tetris's Introduction

Java Tetris

Java Tetris is an implementation of the classic Tetris game using Java and utilises the BAGEL library.

Game Demo

Tetris demo

Game Description

The game features a grid-based playing area where tetrominoes (shapes made up of four blocks) descend from the top of the screen. The player can move and rotate the falling tetrominoes to create horizontal lines with no gaps. When a line is completed, it is cleared from the grid, and the player earns points. As the game progresses, the tetrominoes fall faster, increasing the difficulty.

Getting Started

To run the Java Tetris game on your local machine, follow these steps:

  1. Clone the repository or download the source code.
  2. Open the project in an Integrated Development Environment (IDE) such as Eclipse or IntelliJ IDEA.
  3. Build and compile the project.
  4. Run the javaTetris class, which contains the main method.

How to Play

  1. Run the javaTetris class to start the game.
  2. Use the following controls to play the game:
  • Left Arrow: Move tetromino left
  • Right Arrow: Move tetromino right
  • Down Arrow: Soft drop tetromino (move down faster)
  • Up Arrow: Rotate tetromino clockwise
  • Space: Hard drop tetromino (instantly drop to the bottom)
  • C: Hold tetromino (swap with the saved tetromino)
  • P: Pause and resume the game
  • Esc: Quit the game
  1. Try to clear as many lines as possible and achieve a high score!

Dependencies

Java Tetris uses the BAGEL library, which provides a simple interface for creating games and graphical applications in Java. The library handles window creation, rendering, and user input.

Acknowledgments

Java Tetris was inspired by the classic Tetris game and the Bagel library.

java-tetris's People

Contributors

tonytwei avatar

Watchers

 avatar

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.