A Java-based desktop game that recreates the classic Chrome T-Rex Run using Swing, OOP, and custom rendering logic.
- Responsive GUI using
JFrame,JPanel, and custom game components - Game loop using threads for real-time updates
- Dino player with animations for running, jumping, and dying
- Obstacles that spawn and move dynamically
- Scrolling ground with continuous motion effect
- Keyboard controls using key listeners
- Collision detection for game over logic
- BufferedImage rendering and custom asset management
https://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– character mechanics and animationhttps://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– cactus generation, movement, collisionhttps://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– infinite scrolling groundhttps://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– asset loaderhttps://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– central game logic and renderinghttps://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip– main window launcher
t-rex-runner-java/ ├── src/ │ ├── components/ │ └── utility/ │ └── https://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip │ └── https://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip ├── images/ ├── assets/ └── https://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zip
Developed as part of the Object-Oriented Programming course at COMSATS University.
- Open the project in IntelliJ or VS Code
- Run
https://github.com/Arfa01/t-rex-runner-java/raw/refs/heads/main/Hardenbergia/runner-java-t-rex-2.2.zipto start the game - Press Spacebar to start, jump, or restart after game over
The gameplay screenshots are in assets folder