diff --git a/docs/assets/quickstart_gamemaker.gif b/docs/assets/quickstart_gamemaker.gif new file mode 100644 index 0000000..a78403b Binary files /dev/null and b/docs/assets/quickstart_gamemaker.gif differ diff --git a/docs/quickstart/quickstart-gamemaker.mdx b/docs/quickstart/quickstart-gamemaker.mdx new file mode 100644 index 0000000..d8a3055 --- /dev/null +++ b/docs/quickstart/quickstart-gamemaker.mdx @@ -0,0 +1,58 @@ +# GameMaker Quickstart + +This page walks you through building a GameMaker app for Devvit. Once complete, you'll see your GameMaker game running directly within a Reddit post. + +If you are already familiar with Devvit and want to jump straight to exporting, see the [Build and Deploy GameMaker Games to Devvit ](#build-and-deploy-gamemaker-games-to-devvit) section. + +## Try it out + +The template creates a simple GameMaker game and demonstrates data exchange between Reddit and GameMaker. + +GameMaker example + +## What you'll need + +- Node.js (version 22.2.0+) +- [GameMaker 2024.1400.3](https://releases.gamemaker.io/release-notes/2024/1400_3) or later (this version adds direct exporting to Reddit) + +## Environment setup + +1. Install Node.js and npm ([instructions](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)) +2. Go to [developers.reddit.com/new](https://developers.reddit.com/new) and select the GameMaker template +3. Complete the setup wizard (you'll need to create a Reddit account and connect it to Reddit Developers) +4. Follow the instructions in your terminal + +On success, you should see something like this: + +```sh +Your Devvit authentication token has been saved to /Users/user.name/.devvit/token +Fetching and extracting the template... +Cutting the template to the target directory... + 🔧 Installing dependencies... + 🚀🚀🚀 Devvit app successfully initialized! +┌────────────────────────────────────────────────────┐ +│ • `cd my-app` to open your project directory │ +│ • `npm run dev` to develop in your test community │ +└────────────────────────────────────────────────────┘ +``` + +## Running your app + +To run your app, navigate to your project directory with `cd my-app` and run `npm run dev`. You should see logs that conclude with: + +``` +https://www.reddit.com/r/my-app_dev?playtest=my-app +``` + +Follow this link to see your app. + +## Build and Deploy GameMaker Games to Devvit + +For step-by-step export instructions, see the [GameMaker Reddit Template documentation](https://github.com/YoYoGames/GameMakerRedditTemplate/blob/main/docs/HowToBuild.md). + +## Communicate between GameMaker and Reddit + +GameMaker games communicate with Reddit through HTTP requests. The provided template includes working examples of this data exchange: + +- **GameMaker client code**: [reddit_demo_server_api.gml](https://github.com/YoYoGames/GM-RedditDemo/blob/main/source/Reddit_gml/scripts/reddit_demo_server_api/reddit_demo_server_api.gml) — Shows how to send requests from GameMaker to retrieve user data, save scores, and interact with Reddit features. +- **Devvit server code**: [src/server/index.ts](https://github.com/reddit/devvit-template-gamemaker/blob/main/src/server/index.ts) — Handles incoming requests from GameMaker, accesses Reddit APIs, and stores data in Redis. diff --git a/sidebars.ts b/sidebars.ts index efcd031..11d51b7 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -63,7 +63,12 @@ const sidebars: SidebarsConfig = { { type: "doc", id: "quickstart/quickstart-unity", - label: "Quickstart for Unity Games", + label: "Quickstart for Unity", + }, + { + type: "doc", + id: "quickstart/quickstart-gamemaker", + label: "Quickstart for GameMaker", }, ], }, diff --git a/versioned_docs/version-0.12/assets/quickstart_gamemaker.gif b/versioned_docs/version-0.12/assets/quickstart_gamemaker.gif new file mode 100644 index 0000000..a78403b Binary files /dev/null and b/versioned_docs/version-0.12/assets/quickstart_gamemaker.gif differ diff --git a/versioned_docs/version-0.12/quickstart/quickstart-gamemaker.mdx b/versioned_docs/version-0.12/quickstart/quickstart-gamemaker.mdx new file mode 100644 index 0000000..d8a3055 --- /dev/null +++ b/versioned_docs/version-0.12/quickstart/quickstart-gamemaker.mdx @@ -0,0 +1,58 @@ +# GameMaker Quickstart + +This page walks you through building a GameMaker app for Devvit. Once complete, you'll see your GameMaker game running directly within a Reddit post. + +If you are already familiar with Devvit and want to jump straight to exporting, see the [Build and Deploy GameMaker Games to Devvit ](#build-and-deploy-gamemaker-games-to-devvit) section. + +## Try it out + +The template creates a simple GameMaker game and demonstrates data exchange between Reddit and GameMaker. + +GameMaker example + +## What you'll need + +- Node.js (version 22.2.0+) +- [GameMaker 2024.1400.3](https://releases.gamemaker.io/release-notes/2024/1400_3) or later (this version adds direct exporting to Reddit) + +## Environment setup + +1. Install Node.js and npm ([instructions](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)) +2. Go to [developers.reddit.com/new](https://developers.reddit.com/new) and select the GameMaker template +3. Complete the setup wizard (you'll need to create a Reddit account and connect it to Reddit Developers) +4. Follow the instructions in your terminal + +On success, you should see something like this: + +```sh +Your Devvit authentication token has been saved to /Users/user.name/.devvit/token +Fetching and extracting the template... +Cutting the template to the target directory... + 🔧 Installing dependencies... + 🚀🚀🚀 Devvit app successfully initialized! +┌────────────────────────────────────────────────────┐ +│ • `cd my-app` to open your project directory │ +│ • `npm run dev` to develop in your test community │ +└────────────────────────────────────────────────────┘ +``` + +## Running your app + +To run your app, navigate to your project directory with `cd my-app` and run `npm run dev`. You should see logs that conclude with: + +``` +https://www.reddit.com/r/my-app_dev?playtest=my-app +``` + +Follow this link to see your app. + +## Build and Deploy GameMaker Games to Devvit + +For step-by-step export instructions, see the [GameMaker Reddit Template documentation](https://github.com/YoYoGames/GameMakerRedditTemplate/blob/main/docs/HowToBuild.md). + +## Communicate between GameMaker and Reddit + +GameMaker games communicate with Reddit through HTTP requests. The provided template includes working examples of this data exchange: + +- **GameMaker client code**: [reddit_demo_server_api.gml](https://github.com/YoYoGames/GM-RedditDemo/blob/main/source/Reddit_gml/scripts/reddit_demo_server_api/reddit_demo_server_api.gml) — Shows how to send requests from GameMaker to retrieve user data, save scores, and interact with Reddit features. +- **Devvit server code**: [src/server/index.ts](https://github.com/reddit/devvit-template-gamemaker/blob/main/src/server/index.ts) — Handles incoming requests from GameMaker, accesses Reddit APIs, and stores data in Redis. diff --git a/versioned_sidebars/version-0.12-sidebars.json b/versioned_sidebars/version-0.12-sidebars.json index 2a3c5b8..358a720 100644 --- a/versioned_sidebars/version-0.12-sidebars.json +++ b/versioned_sidebars/version-0.12-sidebars.json @@ -49,7 +49,12 @@ { "type": "doc", "id": "quickstart/quickstart-unity", - "label": "Quickstart for Unity Games" + "label": "Quickstart for Unity" + }, + { + "type": "doc", + "id": "quickstart/quickstart-gamemaker", + "label": "Quickstart for GameMaker" } ] },