Skip to content

Commit

Permalink
Add server connection example
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigabyte5671 committed Jan 14, 2024
1 parent 1e40510 commit 8223124
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,26 @@ const client = new GameClient(path);
### Configuration

The easiest way to configure the client is through the chainable settings methods.
Each method is optional and can be used in any order. For example, to launch the game in a 700px ⨯ 450px window:
Each method is optional and can be used in any order. For example, to launch the game in a 700px ⨯ 450px window:

```js
client
.windowed(true) // Enable windowed mode.
.resolution(700, 450) // Set the resolution.
.team(Team.DiamondSword) // Join the Diamond Sword team.
.start(); // Launch the game.
```

Or to connect directly to a game server:

```js
import { Team } from 'ta-client-api';

client
.connect('example.wilderzone.live', 7777) // Specify the server address and port to connect to.
.team(Team.DiamondSword) // Join the Diamond Sword team.
.start(); // Launch the game.
```

All available settings:
| Setting | Options | Default | Description |
| :----------- | :------------------- | :----------------- | :---------------------------------------------------- |
Expand Down

0 comments on commit 8223124

Please # to comment.