Skip to content

ALISHA8484/Dino-mini-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dino-Minigame ๐Ÿฆ–

A 2D endless runner game inspired by Google Chrome's offline T-Rex game, built from scratch using C++ and the Qt framework. This was developed as a mini-project for my Advanced Programming (AP) course during the second semester of my Computer Engineering degree.

Dino-video.mp4

โœจ Features

  • Classic Gameplay: Run and jump to avoid obstacles for as long as you can.
  • Dynamic Scenery: The ground scrolls, and clouds move across the sky to create a sense of motion.
  • Random Obstacle Generation: Cacti are spawned at random intervals to keep the gameplay challenging.
  • Live Score Tracking: Your score is displayed in the top-left corner and updates in real-time.
  • Collision Detection: The game accurately detects when the player hits an obstacle and triggers the game-over state.
  • Pixel-Art Graphics: Uses custom pixel-art assets for the dinosaur, obstacles, and background elements.

๐Ÿ”ง Tech Stack & Project Structure

This project was built entirely in C++ using the Qt 6 (or 5) framework. It relies heavily on Qt's Graphics View Framework for efficient 2D rendering.

  • Language: C++
  • Framework: Qt
  • Build System: qmake (.pro file)
  • Core Qt Modules: QtWidgets, QGraphicsScene, QTimer, QtGui

Class Structure

The project follows an Object-Oriented design, with key components separated into their own classes:

  • MainWindow: The main application window that houses the graphics scene and UI elements like the score label.
  • Dinasor: Represents the player character. Manages jumping logic and collision detection.
  • Cactus: Represents the enemy obstacles that are spawned on the screen.
  • Cloud: Manages the decorative cloud sprites that drift in the background.
  • Ground: Manages the scrolling ground lines to create the illusion of movement.

๐Ÿš€ Getting Started

To compile and run this project on your local machine, you will need to have the Qt development tools installed.

Prerequisites

Installation & Running

  1. Clone the repository:

    git clone [https://github.com/ALISHA8484/Dino-mini-game.git]
  2. Navigate to the project directory:

    cd Dino-minigame
  3. Build and run using Qt Creator:

    • Open the Dino-minigame.pro file in Qt Creator.
    • Configure the project with a valid Qt Kit.
    • Click the green "Run" button (or press Ctrl+R).

๐ŸŽฎ How to Play

  • Launch the game.
  • Press the Spacebar to make the dinosaur jump over the cacti.
  • The game ends when you collide with a cactus.
  • Survive as long as you can to get the highest score!

๐Ÿ“„ License

This project is open-source and available under the MIT License. See the LICENSE file for more details.

About

๐Ÿฆ– A 2D endless runner game inspired by the Chrome T-Rex, created as a C++/Qt university

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors