
<a name="readme-top"></a>

<!-- GENERAL GAME INFO -->  
<br />  
<div align="center">  

  <h1 align="center">Motherload</h1>  

  <p align="center">  
    Gather resources and buy upgrades to dig as far as you can. You have to dig ores and sell them to earn cash which you use to buy fuel, digger upgrades, explosives, and other supplies. You can only sell ore and buy items at the surface. If you run out of fuel, your digger explodes and you die (game over). There are more valuable (and heavier) ores as you go deeper into the mine. There are several types of alien artifacts which are of considerable value and appear randomly throughout the mine (below 950 feet).   
    <br />  
    <strong>Original game : </strong>  
    <a href="https://xgenstudios.fandom.com/wiki/Motherload"><strong>General info »</strong></a>  
    ·  
    <a href="https://www.youtube.com/watch?v=QCMbRe8ij5g&t=322s&pp=ygUTbW9odGVybG9hZCBnYW1lcGxheQ%3D%3D"><strong>Youtube video »<strong></a>  
    <br />  
    <br />  
  </p>  
</div>  



<!-- TABLE OF CONTENTS -->  
<details>  
  <summary>Table of Contents</summary>  
  <ol>  
    <li>  
      <a href="#about-the-project">About The Project</a>  
    </li>  
    <li>  
      <a href="#my-version">My version</a>  
    </li>  
    <li>  
      <a href="#getting-started">Getting Started</a>  
    </li>  
    <li><a href="#how-to-play">How To Play</a></li>  
    <li><a href="#class-structure">Class structure</a></li>  
    <li><a href="#checklist">Checklist</a></li>  
    <li><a href="#contact">Contact</a></li>  
    <li><a href="#acknowledgments">Acknowledgments</a></li>  
  </ol>  
</details>  



<!-- ABOUT THE PROJECT -->  
## About The Project


![screenshot.jpg](Assets%2Fscreenshot.jpg)

Here's why:
* It's a classic game that I played when I was younger.
* It's a game that I can make in a reasonable amount of time.
<p align="right">(<a href="#readme-top">back to top</a>)</p>  


## My version

This section gives a clear and detailed overview of which parts of the original game I planned to make.

### The minimum I will most certainly develop:
* Player movement
* Resource Collection
* Random Generated world
* The fuel and sell building

### What I will probably make as well:
* Dying
* Working Lava

### What I plan to create if I have enough time left:
* Main Menu, Options Screen
* Boss fight

<p align="right">(<a href="#readme-top">back to top</a>)</p>  


<!-- GETTING STARTED -->  
## Getting Started
This project now includes a CMake build in addition to the original Visual Studio solution files.
For the longer version, troubleshooting, and platform notes, see [`BUILDING.md`](BUILDING.md).

### Prerequisites

#### Windows
* Visual Studio 2022 with the Desktop development with C++ workload
* CMake 3.21 or newer

The repository already contains prebuilt SDL2 / SDL2_image / SDL2_mixer / SDL2_ttf Windows packages in `Libraries/`, and the CMake build will use those by default.

#### Linux
Install the development packages first.

Ubuntu / Debian example:
```bash
sudo apt install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libgl1-mesa-dev
```

### Build with CMake

#### Windows, Visual Studio 2022
```bash
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Debug
```

The executable will be generated in `build/bin/` or the selected Visual Studio configuration output folder. Resource files are copied automatically after the build.

#### Linux
```bash
cmake -S . -B build
cmake --build build
```

The executable will be generated in `build/bin/`. Resource files are copied automatically after the build.

### Run the game

After building, run the generated executable from the build output directory so that the copied resource files are next to it.

### Notes

* The original `.sln` and `.vcxproj` files are still present and can still be used in Visual Studio.
* The CMake build creates the same two logical targets as the solution: `Engine` and `Motherload`.
* On non-Windows platforms, SDL dependencies are expected to come from the system package manager.

<p align="right">(<a href="#readme-top">back to top</a>)</p>  

<!-- HOW TO PLAY -->  
## How to play

### Controls
* W A S D
* Mouse For menues

<p align="right">(<a href="#readme-top">back to top</a>)</p>  



<!-- CLASS STRUCTURE -->  
## Class structure

### Object composition
#### Player
The player has a bunch of objects in the Player class, These are
- Animations
- Particles
- SoundEffects
#### WorldLevel
The world level contains all the objects for the "Main" Game. These are
- Player
- GridManager
- Background Music
- MainScreen (Game UI)
- The Sun and Moon

### Inheritance
Here are a couple examples on how i used Inheritance throughout the project.

#### Screens
The Screen class is the base class for all the screens in the game. <br>  
This Class manages all the GuiElements inside of it. <br>  
Also all the subscreens, eg. FuelScreen, SellScreen, even the Main Game ui is a subclass of the Screen type.

#### GuiElement
The whole Screen system is based on the GuiElement. This class has a Draw and Update Function. <br>  
This is because the Screen class calls these for each of the subclasses of a GuiElement. <br>  
For Example, the Button class is a subclass of GuiElement. <br>  
The Button class has a Draw and Update function that the Screen class calls. The screen does not know what type of <br>  
update it's calling, it just knows that it's calling the update function of a GuiElement.


<p align="right">(<a href="#readme-top">back to top</a>)</p>  


<!-- CHECKLIST -->  
## Checklist

- [x] Accept / set up github project
- [x] week 01 topics applied
- [x] week 02 topics applied
- [x] week 03 topics applied
- [x] week 04 topics applied
- [x] week 05 topics applied
- [x] week 06 topics applied
- [x] week 07 topics applied
- [x] week 08 topics applied
- [x] week 09 topics applied (optional)
- [x] week 10 topics applied (optional)

<p align="right">(<a href="#readme-top">back to top</a>)</p>  

<!-- CONTACT -->  
## Contact

Bram Verhulst - bram.verhulst@student.howest.be

Project Link: [Here](https://github.com/HowestDAE/dae16-VerhulstBram)  
Alternative Project Link (Gitea): [Here](https://git.brammie15.dev/brammie15/dae16-VerhulstBram-GameProject)

<p align="right">(<a href="#readme-top">back to top</a>)</p>  


<!-- ACKNOWLEDGMENTS -->  
## Acknowledgments

Use this space to list resources you find helpful and would like to give credit to.

* [Example 1: cpp reference on std::vector](https://en.cppreference.com/w/cpp/container/vector)
* [Dear ImGui for development](https://github.com/ocornut/imgui)

<p align="right">(<a href="#readme-top">back to top</a>)</p>
