> For the complete documentation index, see [llms.txt](https://docs.miniton.games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.miniton.games/developer-success/miniton-gaming-sdk/start-your-game-until-end.md).

# Start your game until end

## Set “Start Game” Button Click Event Callback

After the progress bar has finished loading, the player can start the game by clicking the “**Start**” button on the page.&#x20;

The game frontend needs to place the game start logic code within the callback function to handle this event.

```javascript
MINITONSDK.setStartGameButtonCallbak(callback);
```

#### Parameters

<table><thead><tr><th>Parameter</th><th width="136">Type</th><th>Description</th></tr></thead><tbody><tr><td>callback</td><td>Function</td><td>The callback function for the "Start Game" button click event. This function contains the logic to start the game when the player clicks the button.</td></tr></tbody></table>

#### Return

none

#### Example

```javascript
MINITONSDK.setStartGameButtonCallbak(() => {
    ...
});
```

## Set the Game Over

This function should be called by the frontend when the player's game ends. It ensures that the game-over state is properly handled in frontend.&#x20;

Backend still need call  `end_game` information to MiniTon, though frontend called following function.

```javascript
MINITONSDK.setGameOver();
```

#### **Parameters:**

None

**Return:**

None


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.miniton.games/developer-success/miniton-gaming-sdk/start-your-game-until-end.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
