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