Skip to content

doanhtu07/dinosaur-game

Repository files navigation

dinosaur-game

A simple jumping dinosaur game in C++ that is inspired from T-Rex Runner game in Google Chrome

This is for me to learn and play around with C++ after a long time abandoning it

Resources + Inspiration

Learning

  • C++ OOP: Pass by reference, class composition, header vs cpp
  • Basic game mechanics: C++ SFML, sprite loading, collision boxes

Requirements

  • cmake: brew install cmake (MacOS)

    • A cross-platform build system generator used to manage the build process of software projects
  • vcpkg: brew install vcpkg (MacOS) and follow other instructions from brew's messages after brew finishes installing

    • A C/C++ package manager by Microsoft

Run

LEGACY:

  • Must run ./build/Dinosaur at the root of the project so that it can find images

NOW:

  • cmake --preset=default -DCMAKE_EXPORT_COMPILE_COMMANDS=1: Prepare a build folder according to our preset
  • cmake --build ./build/: Actually build our C/C++ files into target using our CMakeLists.txt
  • ./build/Dinosaur: Run our game executable

Quick Demo

Screen.Recording.2024-08-03.at.10.31.06.PM.mov

About

A simple jumping dinosaur game in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published