Skip to content
/ T-rex Public

A modern implementation of the classic Chrome dinosaur game.

License

Notifications You must be signed in to change notification settings

Avil-XD/T-rex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

T-Rex Runner Game

A modern implementation of the classic Chrome dinosaur game built with p5.js. Features responsive design, accessibility improvements, and touch support.

How to run?

Click on this link to run the game. ๐Ÿ‘‰ T-Rex Runner

๐ŸŽฎ Features

  • Classic T-Rex running and jumping gameplay
  • Responsive design that works on all devices
  • Score and high score tracking
  • Touch and keyboard controls
  • Accessible design with keyboard navigation
  • Progressive difficulty increase

๐Ÿš€ Getting Started

Prerequisites

No installation needed! Just a modern web browser.

Running Locally

  1. Clone the repository:
git clone https://github.com/yourusername/t-rex.git
cd t-rex
  1. Start a local server (any of these methods):
# Using Python 3
python -m http.server

# Using Node.js
npx http-server

# Using PHP
php -S localhost:8000
  1. Open your browser and navigate to:
  • http://localhost:8000 (for Python/PHP)
  • http://localhost:8080 (for http-server)

๐ŸŽฏ How to Play

  • Press SPACE or UP ARROW key to make the T-Rex jump
  • Avoid the cacti obstacles
  • Press R to restart when game is over
  • Your score increases the longer you survive
  • The game gets progressively faster

๐Ÿ“ Project Structure

t-rex/
โ”œโ”€โ”€ index.html          # Main HTML file
โ”œโ”€โ”€ style.css           # Styles and responsive design
โ”œโ”€โ”€ sketch.js           # Game logic using p5.js
โ”œโ”€โ”€ p5.js              # p5.js library
โ”œโ”€โ”€ p5.play.js         # p5.play library for sprite handling
โ”œโ”€โ”€ p5.sound.min.js    # p5.sound library
โ”œโ”€โ”€ assets/            # Game images
โ”‚   โ”œโ”€โ”€ trex1.png
โ”‚   โ”œโ”€โ”€ trex3.png
โ”‚   โ””โ”€โ”€ ...
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Built With

  • p5.js - JavaScript library for creative coding
  • HTML5 Canvas
  • CSS3 with modern features
  • Vanilla JavaScript

๐ŸŽจ Customization

The game can be customized by modifying:

  • style.css - Visual appearance and layout
  • sketch.js - Game mechanics and difficulty
  • Asset images - Visual elements

๐Ÿค Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Original Chrome T-Rex game by Google
  • p5.js community for the amazing library
  • All contributors and users of this game