diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ec5ad12..276b3df 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -arthur.pacaud@hotmail.fr. +. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the @@ -116,7 +116,7 @@ the community. This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). @@ -124,5 +124,5 @@ enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +. Translations are available at +. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38036af..c93a9d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Thanks for your interest in contributing to THNK! We value them a lot, and hope to see you stick around :) -Although THNK is a program, non-code contributions are very welcome too! If you do not feel confortable writing code, you can also contribute to the project by: +Although THNK is a program, non-code contributions are very welcome too! If you do not feel comfortable writing code, you can also contribute to the project by: - Creating and sharing an example - Publishing video tutorials @@ -15,7 +15,7 @@ Although THNK is a program, non-code contributions are very welcome too! If you - Hunting for bugs - Code-reviewing PRs - Sending supportive messages to all contributors :) -- Staring the repository +- Starring the repository With that said, let's look at how to contribute to THNK! @@ -57,11 +57,12 @@ The GDevelop extensions are contained in `extensions`. You can install the lates ## Building - Test your changes You will need the following tools to build THNK: + - NodeJS (Preferably v16 LTS) - Yarn - A system that can run FlatBuffer's `flatc` -When you first download the repository, you will need to install dependencies by running `yarn`. Remember to run it again regularely to ensure you are using the same version and dependencies as everyone else! +When you first download the repository, you will need to install dependencies by running `yarn`. Remember to run it again regularly to ensure you are using the same version and dependencies as everyone else! To launch a full build of THNK, run `yarn build`. You can also run the build step-by-step: diff --git a/code/adapters/local.ts b/code/adapters/local.ts index cba27ef..7c9c816 100644 --- a/code/adapters/local.ts +++ b/code/adapters/local.ts @@ -7,7 +7,7 @@ namespace THNK { ); const bc = new BroadcastChannel("thnk-local-server"); bc.addEventListener("messageerror", (e) => - logger.error("An error occured while sending a message!", e) + logger.error("An error occurred while sending a message!", e) ); const ownID = "" + Date.now() + Math.random() * 1000; diff --git a/code/relay/README.md b/code/relay/README.md index 2322e4c..99a9f67 100644 --- a/code/relay/README.md +++ b/code/relay/README.md @@ -12,7 +12,7 @@ Each room can optionally have a variable with data set by the owner of a room. T ## Room tags (TODO) -A room's owne can add and remove tags from their room. Any player can query rooms by one or multiple tags. The amount of rooms returned by a query can be limited. +A room's owner can add and remove tags from their room. Any player can query rooms by one or multiple tags. The amount of rooms returned by a query can be limited. This can be used for discovering rooms, matchmaking, and cumulating filters on the former two. diff --git a/code/server/SnaphsotManager.ts b/code/server/SnaphsotManager.ts index d502122..a8ca052 100644 --- a/code/server/SnaphsotManager.ts +++ b/code/server/SnaphsotManager.ts @@ -11,7 +11,7 @@ import { serializeRGB } from "./SerializeRGB"; export class SnapshotsManager { /** The number of diffs to keep */ diffsCount: number; - /** The list of previous difs in case one gets missed by the client. */ + /** The list of previous diffs in case one gets missed by the client. */ diffs: Array; /** The index of the current diff. */ currentDiff = 0; diff --git a/code/server/THNKServerContext.ts b/code/server/THNKServerContext.ts index c8a5b3f..039ecd7 100644 --- a/code/server/THNKServerContext.ts +++ b/code/server/THNKServerContext.ts @@ -23,7 +23,7 @@ export class THNKServerContext { runServerCode: boolean = true; /** List of users that already know this scene, used when unpausing a scene to only send a snapshot to those who do not have it in memory already. */ previouslyConnectedUsers?: Set; - /** Stores snapshots of the diffs of a hanful of previous frames. */ + /** Stores snapshots of the diffs of a handful of previous frames. */ snapshotsManager = new SnapshotsManager(); constructor(adapter: ServerAdapter, stateVariables: StateVariables) { diff --git a/code/tests-utils/gdjs-mock.ts b/code/tests-utils/gdjs-mock.ts index 244b274..b8d7f9d 100644 --- a/code/tests-utils/gdjs-mock.ts +++ b/code/tests-utils/gdjs-mock.ts @@ -143,7 +143,7 @@ export class Variable { } /** - * Unserialize a JSON string into this variable. + * Deserialize a JSON string into this variable. * * This just logs an error if the JSON is invalid. * diff --git a/code/types/thnk.d.ts b/code/types/thnk.d.ts index 34bbc43..f0b54cb 100644 --- a/code/types/thnk.d.ts +++ b/code/types/thnk.d.ts @@ -18,7 +18,7 @@ declare global { /** A reference to the `State` variable of the object, if it is replicated and on the server. */ stateVariables: StateVariables; - // Previous values are stored to not send unecessary data + // Previous values are stored to not send unnecessary data prevX: number; prevY: number; prevAngle: number; diff --git a/docs/README.md b/docs/README.md index 8f449db..f10faff 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,14 +8,14 @@ Contributing is simple and welcome! Just submit a PR with your changes. ### Installation -``` -$ yarn +```bash +yarn ``` ### Display the website with local changes -``` -$ yarn start +```bash +yarn start ``` This command starts a local development server and opens it up in a browser window. Most changes are reflected live without having to restart the server. diff --git a/docs/docs/concepts/game-state.md b/docs/docs/concepts/game-state.md index adaf71e..7e537e5 100644 --- a/docs/docs/concepts/game-state.md +++ b/docs/docs/concepts/game-state.md @@ -15,7 +15,7 @@ THNK takes care of synchronizing the game state from the server to the client. F ### Objects -Objects can be marked as game state in THNK by adding the "Synchronize" behvaior on them. This behavior will watch for changes on the object and automatically sync those on clients. +Objects can be marked as game state in THNK by adding the "Synchronize" behavior on them. This behavior will watch for changes on the object and automatically sync those on clients. :::note diff --git a/docs/docs/getting-started/local-networking.md b/docs/docs/getting-started/local-networking.md index 5cd7708..b576387 100644 --- a/docs/docs/getting-started/local-networking.md +++ b/docs/docs/getting-started/local-networking.md @@ -1,6 +1,6 @@ --- sidebar_position: 4 -description: A game is never totally the same in multiplayer than it is in single player. Learn how to preview and test out your game's multiplayer locally in this fouth part of the getting started tutorial! +description: A game is never totally the same in multiplayer than it is in single player. Learn how to preview and test out your game's multiplayer locally in this fourth part of the getting started tutorial! keywords: - get started - platformer @@ -32,6 +32,6 @@ Before implementing an adapter to connect your players together, it's useful to ## Setup the local adapter -Simply install the [local adapter extension](https://raw.githubusercontent.com/arthuro555/THNK/master/extensions/THNK_Local.json), create a new scene (I like to call it something aalong the lines of `MultiplayerQuickStart`), and put the action from the local adapter to start a server with 2 clients at thee beginning of the scene. +Simply install the [local adapter extension](https://raw.githubusercontent.com/arthuro555/THNK/master/extensions/THNK_Local.json), create a new scene (I like to call it something along the lines of `MultiplayerQuickStart`), and put the action from the local adapter to start a server with 2 clients at the beginning of the scene. That's it! Now, previewing this scene will start a server with the scene and the amount of clients you requested, each in a separate window, for you to test out the game in multiplayer mode. diff --git a/docs/docs/getting-started/setup-p2p.md b/docs/docs/getting-started/setup-p2p.md index c7c7597..e43a320 100644 --- a/docs/docs/getting-started/setup-p2p.md +++ b/docs/docs/getting-started/setup-p2p.md @@ -28,7 +28,7 @@ Screenshots and videos are still missing, come back later if you need them! ::: -To connect players together, an adapter is required. Each have different tradeoffs, and you can learn [more about each of them here](../misc/picking-an-adapter.md). We'll use P2P as you might already be somewhat familliar with it, as it is integrated in GDevelop. +To connect players together, an adapter is required. Each have different tradeoffs, and you can learn [more about each of them here](../misc/picking-an-adapter.md). We'll use P2P as you might already be somewhat familiar with it, as it is integrated in GDevelop. ## Setting up P2P @@ -48,13 +48,13 @@ Then, to connect, --- -First, let's create a menu scene that contains a "Connceting to server" text in the middle. While we are not connected to the broker, it is useless to propose any other option as starting a server or connecting to one is impossible without a P2P ID provided by the broker. +First, let's create a menu scene that contains a "Connecting to server" text in the middle. While we are not connected to the broker, it is useless to propose any other option as starting a server or connecting to one is impossible without a P2P ID provided by the broker. We can, at the beginning of the scene, simply call the "Connect to the default broker server" action. :::info TURN/STUN servers -If you are going to add TURN/STUN servers as ICE candidates (recomended as a fallback if the player's firewall block P2P connections), they must be called just before connecting to the broker, not after! +If you are going to add TURN/STUN servers as ICE candidates (recommended as a fallback if the player's firewall block P2P connections), they must be called just before connecting to the broker, not after! ::: @@ -81,7 +81,7 @@ That next step is to display two buttons: one for client, one for server. The client connection should allow typing in an ID. A text input object is the best: it allows to manually write the ID if needed, but also allows pasting in the ID. -Once the player finishes entering the ID, they need to be able to innitiate the connection. You can use a button from the GDevelop asset store for this. +Once the player finishes entering the ID, they need to be able to initiate the connection. You can use a button from the GDevelop asset store for this. When the button is pressed, simply use the P2P adapter's "Connect to server at < P2P ID >". Use the text input's expressions to get the entered ID. @@ -92,7 +92,7 @@ In order for clients to connect, a THNK server needs to be started first. The se In this game, it makes sense to allow players to join and leave the game anytime after it started, akin to minecraft. Therefore, we'll just start the game scene directly as a THNK P2P server, using the corresponding action from the P2P adapter. To allow clients to connect, we'll add a _read-only and disabled text input object_ containing the P2P ID in the platformer scene. -This is the best way to make selectable text, allowing to easily copy-paste it in an intuitive manner, while allowoing to also simply read it out to a friend. +This is the best way to make selectable text, allowing to easily copy-paste it in an intuitive manner, while allowing to also simply read it out to a friend. :::tip Lobby diff --git a/docs/docs/getting-started/simple-platformer.mdx b/docs/docs/getting-started/simple-platformer.mdx index a813efb..08b9e3e 100644 --- a/docs/docs/getting-started/simple-platformer.mdx +++ b/docs/docs/getting-started/simple-platformer.mdx @@ -64,7 +64,7 @@ Here, player animations: Therefore, it should be in the client section!