Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlinx committed Oct 20, 2024
1 parent e2ed8d1 commit 37bff29
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
37 changes: 36 additions & 1 deletion GameMakerTestGame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,39 @@ Last tested on GameMaker 2024.8.1.171

## Minigame Manager Library

- TODO
### Installation

1. Download the `scripts/c_minigame_manager` and `objects/o_minigame_manager` folders and add them to your GameMaker project.

### Usage

- Starting the game
1. Call `init_minigame_manager()` and pass in your minigame name
2. Spawn players using the `global.minigame_manager.player_data_array`
- Ending the game
1. Call `end_game` on the `global.minigame_manager` and pass in an array of player results

**Ex.**

```gml
// Inside Create event of a object that's in charge
// of handling the lifecycle of the game

// Initialize minigame manager
init_minigame_manager("GameMaker Test Game");

// Spawn players
var player_count = array_length(_player_data_array)
for (var i = 0; i < player_count; i++) {
show_debug_message("Spawning player: {0} with data: {1}", i, _player_data_array[i]);
}

// End the game and assign points to each player
//
// In the example below, we give 1 point to
// player 1 and 3 points to player 2
global.minigame_manager.end_game([
new PlayerResult(0, 1),
new PlayerResult(1, 3),
]);
```
1 change: 1 addition & 0 deletions GodotTestGame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Last tested on Godot 4.3

1. Download `scripts/mini_game_manager.gd` and add it to your Godot project.
2. Create a `Node` in your game's main scene and attach the `mini_game_manager.gd` script.
3. Set the `game_name` property on the minigame manager node to your minigame's name.

### Usage

Expand Down
3 changes: 2 additions & 1 deletion UnityTestGame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Last tested on Unity 6000.0.23f1

### Installation

1. Download `Assets/Scripts/MiniGameManager.cs` and add it to your Godot project.
1. Download `Assets/Scripts/MiniGameManager.cs` and add it to your Unity project.
2. Attach the `MiniGameManager` component to a GameObject in your game's main scene.
3. Set the `GameName` field on the minigame manager component to your minigame's name.

### Usage

Expand Down

0 comments on commit 37bff29

Please sign in to comment.