Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 107 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,112 @@
# Below The Surface

<p align="left">
<img width="150px" src="https://github.com/thoth-tech/.github/blob/main/images/splashkit.png"/>
</p>

[![GitHub contributors](https://img.shields.io/github/contributors/thoth-tech/below-the-surface?label=Contributors&color=F5A623)](https://github.com/thoth-tech/below-the-surface/graphs/contributors)
[![GitHub issues](https://img.shields.io/github/issues/thoth-tech/below-the-surface?label=Issues&color=F5A623)](https://github.com/thoth-tech/below-the-surface/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/thoth-tech/below-the-surface?label=Pull%20Requests&color=F5A623)](https://github.com/thoth-tech/below-the-surface/pulls)
[![Forks](https://img.shields.io/github/forks/thoth-tech/below-the-surface?label=Forks&color=F5A623)](https://github.com/thoth-tech/below-the-surface/network/members)
[![Stars](https://img.shields.io/github/stars/thoth-tech/below-the-surface?label=Stars&color=F5A623)](https://github.com/thoth-tech/below-the-surface/stargazers)

**Below The Surface** is an action-adventure game developed using the SplashKit SDK. Dive deep into a thrilling, underwater world filled with challenges, enemies, and interactive elements. Designed for compatibility with the **Arcade Machine**, this game provides an engaging experience for one or two players.

## Overview

In **Below The Surface**, players navigate through underwater terrain, overcome obstacles, and engage in combat with various creatures. The game is designed to challenge both solo players and teams, with optimized controls for the Arcade Machine to ensure smooth gameplay.

## How to Install

- Install [Splashkit](https://www.splashkit.io) to your computer
- Enter command `git clone https://github.com/thoth-tech/arcade-games` to your terminal
- Enter command `cd arcade-games/games/BelowTheSurface`
- Enter command `skm g++ program.cpp -o game`
- Enter command `./game` to play

<!--
Orginal Controles for game updated to suit Arcade Machine
### **Player 1**

| Input | Description |
| --- | ----------- |
| W Key | Jump |
| A Key | Move Left |
| D Key | Move Right |
| S Key | Crouch |
| F Key | Attack/Interact |

### **Player 2**

| Input | Description |
| --- | ----------- |
| Up Arrow | Jump |
| Left Arrow | Move Left |
| Right Arrow | Move Right |
| Down Arrow | Crouch |
| L Key | Attack/Interact |

### **Other Buttons**

| Input | Description |
| --- | ----------- |
| Enter / H Key | Pause |
| Enter / F Key | Selection | -->

> controls for arcade machine
### **Player 1**

| Input | Description |
| --- | ----------- |
| Up Key or Left Alt| Jump |
| Left Key | Move Left |
| Right Key | Move Right |
| Down Key | Crouch |
| Left Crtl Key | Attack/Interact |

### **Player 2**

| Input | Description |
| --- | ----------- |
| R Key or S Key| Jump |
| D Key | Move Left |
| G Key | Move Right |
| F Key | Crouch |
| A Key | Attack/Interact |

### **Other Buttons**

| Input | Description |
| --- | ----------- |
| Enter / P Key | Pause |
| Enter / Left Ctrl Key | Selection |


#### Edited:

- Enter command `skm g++ -O3 program.cpp -o game` for optimisations
- Reduced resolution on game and assets.
- Changed button placement and asset placement to better fit new resolution
Follow these steps to download, build, and run **Below The Surface** on your computer:

### Step 1: Install SplashKit

Ensure you have the SplashKit SDK installed on your computer. You can download it from the [SplashKit website](https://www.splashkit.io/installation).

### Step 2: Clone the Repository

Open your terminal and clone the arcade-games repository, which includes **Below The Surface**:

```bash
git clone https://github.com/thoth-tech/arcade-games
```

### Step 3: Navigate to the Game Directory

Move into the game's directory within the repository:

```bash
cd arcade-games/games/BelowTheSurface
```

### Step 4: Build the Game

Compile the game using SKM (SplashKit Manager) with the following command:

```bash
skm g++ program.cpp -o game
```

For optimized performance, you can use the `-O3` flag for an optimized build:

```bash
skm g++ -O3 program.cpp -o game
```

### Step 5: Play the Game

Run the game by entering the following command:

```bash
./game
```

## Controls

The controls for **Below The Surface** have been adapted to work seamlessly with the Arcade Machine setup. Here are the mappings for each player:

### Player 1

| Input | Action |
|----------------------|--------------------|
| Up Arrow / Left Alt | Jump |
| Left Arrow | Move Left |
| Right Arrow | Move Right |
| Down Arrow | Crouch |
| Left Ctrl | Attack/Interact |

### Player 2

| Input | Action |
|----------------------|--------------------|
| R Key / S Key | Jump |
| D Key | Move Left |
| G Key | Move Right |
| F Key | Crouch |
| A Key | Attack/Interact |

### Other Controls

| Input | Action |
|---------------------|--------------------|
| Enter / P Key | Pause |
| Enter / Left Ctrl | Selection |

## Game Features

- **Multiplayer Support**: Play solo or team up with a friend in a two-player mode, with distinct control setups for each player.
- **Interactive Environment**: Explore underwater environments with obstacles, hidden treasures, and interactive objects.
- **Combat and Interactions**: Engage with various underwater creatures and interact with the environment to uncover new areas and items.

## Optimizations & Modifications

To ensure the game runs smoothly on the Arcade Machine, several adjustments and optimizations have been made:

- **Optimized Build**: Use `skm g++ -O3 program.cpp -o game` for an optimized version, which improves performance by reducing execution time and memory usage.
- **Resolution Adjustments**: The game resolution and asset quality have been adjusted for compatibility with the Arcade Machine, ensuring smoother gameplay and faster load times.
- **Control Customization**: Controls have been reconfigured to align with the Arcade Machine's setup, making gameplay intuitive for both single and dual-player modes.

## Contributing

We welcome contributions from the community to enhance and expand **Below The Surface**. If you have ideas for new features, improvements, or optimizations, feel free to submit a pull request or open an issue on the repository.
132 changes: 75 additions & 57 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,110 @@
# Below the Surface Documentation

Welcome to the development documentation for **Below the Surface**! This project is a collaborative effort to create an exceptional game for the **Arcade Machine**. This guide provides an overview of the core files, level management, and setup instructions to help you contribute effectively to the game.

# Below the Surface Documentation
---

This is a collaborative effort to create an **exceptional game** to be implemented within the **Arcade Machine**.
## Project Structure

### Header Files

## Header Files
Below are the key header files you’ll encounter while developing **Below the Surface**:

Here are the following header files that you should be aware of while developing this game.
- **`player.h`**: Defines the `Player` class, along with its attributes, functions, and states.
- **`map.h`**: Manages game content display, including backgrounds and map elements.
- **`level.h`**: Responsible for scene management, such as level transitions and collision checks.
- **`enemy.h`**: Contains the enemy classes with their attributes and behaviors.
- **`behaviour.h`**: Manages AI behavior for different enemy types.
- **`block.h`**: Defines the behavior of individual blocks in the game.
- **`camera.h`**: Tracks the player’s movements across the level.
- **`cellsheet.h`**: Defines the cell structure used for game elements.
- **`collision.h`**: Handles collision detection and responses throughout the game.
- **`get_level.h`**: Loads and renders a level on the screen.
- **`hud.h`**: Manages the player’s HUD (Heads-Up Display) for displaying health, score, etc.
- **`screen.h`**: Handles rendering of the game on the screen.
- **`testing.h`**: Provides functions for testing various components during development.

**player.h**
Header file containing the player class, its attributes, functions, and states.
---

**map.h**
Header file containing the necessary contents for the game to display when playing.
## Level Management

**level.h**
Header file responsible for scene management. Such as switching levels or checking collisions.
### Level Text Files

**enemy.h**
Header file containing enemy classes, its attributes and functions.
The **`levels`** folder contains text files that represent different game levels. Each file uses block IDs to define the layout of the levels, which can be created or edited in the **Level Editor**.

**behaviour.h**
Header file responsible for determining the AI behaviour of different enemy class.
**Important**: **Do not manually change the values inside these text files** to avoid unintended modifications. Use the Level Editor to create or edit levels instead.

**block.h**
Header file responsible for each of the block's behaviour.
### Testing a Level

**camera.h**
Header file responible for tracking the player around the level.
To test a custom level, run the following command in the terminal:

**cellsheet.h**
Header file responsible for the definition of cells.
#### Format

**collision.h**
Header file responsible for handling collisions throughout the level.
```bash
./test -l {number of layers} levels/{layer0.txt} levels/{layer1.txt} {level name}
```

**get_level.h**
Header file responsible for grabbing a level from header files level to screen.
#### Example

**hud.h**
Header file responsible for the display of the player HUD.
```bash
./test -l 2 levels/layer0.txt levels/layer1.txt test
```

**screen.h**
Header file responsible for displaying the game onto the screen.
### Loading a Level in the Level Editor

**testing.h**
Header file responsible for testing functions.

## Level Text Files
Within folder **levels** there are text files filled with block id. These ids are the what represents the levels that you see within the game. And you can create one by using the level editor. Just make sure to add them in the folder once you've created it. **DO NOT CHANGE THE VALUES INSIDE THE TEXT FILES**. Otherwise, the levels will be modified. If you want to test out the level you have created, write the following code.
To edit an existing level, load it in the Level Editor with this command:

### Format
```
./test -l {amount of layers} levels/{layer0.txt} levels/{layer1.txt} {name of the level}
```
#### Format

### Example
```
./test -l 2 file0.txt file1.txt test
```bash
./test -load {number of layers} levels/{layer0.txt} levels/{layer1.txt}
```

## Loading Levels in Level Editor
If you want to edit an existing level. Drag the files of that level onto the level editor, compile, and write the following.
#### Example

### Format
```
./test -load {amount of layers} {layer0.txt} {layer1.txt}
```bash
./test -load 1 levels/layer0.txt
```

### Example
```
./test -load 1 file0.txt
```
Ensure you have the latest versions of both the game and the Level Editor for compatibility.

Keep in mind, to have both the latest versions of the game and the level editor.
---

## Create files and folders
The file explorer is accessible using the button in left corner of the navigation bar. You can create a new file by clicking the **New file** button in the file explorer. You can also create folders by clicking the **New folder** button.
## Using the File Explorer

## Compiling the game and opening the .exe file
To compile the game, write the following prompt onto the terminal. Keep in mind to also have and set the directory of where you have the repo located in your system onto the terminal
```
To manage files and folders, use the file explorer accessible from the left corner of the navigation bar in the development environment:

- **Create New File**: Click **New File** to add a new file within the current directory.
- **Create New Folder**: Click **New Folder** to organize files within folders.

---

## Compiling and Running the Game

### Compiling the Game

To compile the game, use the following command in your terminal. Ensure your terminal is in the correct directory where the repository is located.

```bash
skm clang++ -o test program.cpp
```
Once compiled, run the .exe file by writing the following prompt onto the same terminal
```

### Running the Game

Once compiled, you can run the game with the command:

```bash
./test
```

### Optimized Compilation

For an optimized build, use the `-O3` flag to improve performance:

```bash
skm clang++ -O3 -o test program.cpp
```

---

This documentation should provide all the information you need to work on **Below the Surface**, from managing files and levels to compiling and running the game. If you have further questions or encounter issues, please refer to the README in the main repository or reach out to the project maintainers.