hytopia 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # HYTOPIA SDK
2
2
 
3
3
  ## Quick Links
4
- [Quickstart](#quickstart) • [Developer Docs](https://dev.hytopia.com/) • [API Reference](./docs/server.md) • [Examples](./examples) • [Join Our Developer Discord](https://discord.gg/hytopia-developers) • [Report Bugs or Request Features](https://github.com/hytopiagg/sdk/issues)
4
+ [Quickstart (Start Here)](#quickstart-start-here) • [Developer Docs](https://dev.hytopia.com/) • [API Reference](./docs/server.md) • [Examples](./examples) • [Join Our Developer Discord](https://discord.gg/hytopia-developers) • [Report Bugs or Request Features](https://github.com/hytopiagg/sdk/issues)
5
5
 
6
6
  ## What is HYTOPIA?
7
7
 
@@ -28,32 +28,9 @@ Available as a simple NPM package, this SDK provides everything you need to get
28
28
 
29
29
  With these resources, you can quickly build and share immersive, voxel-style multiplayer games on HYTOPIA.
30
30
 
31
- ## Quickstart
31
+ ## Quickstart (Start Here)
32
32
 
33
- 1. Install a compatible JavaScript runtime. We recommend you use [Bun](https://bun.sh/), but [Node.js](https://nodejs.org/) and [Deno](https://deno.com/) can work with additional configuration. All examples will be given using Bun.
34
-
35
- 2. Create a new project directory somewhere on your machine and navigate into it.
36
- ```bash
37
- mkdir my-project-directory && cd my-project-directory
38
- ```
39
-
40
- 3. Initialize a hytopia project from boilerplate or an existing example. Sets up package.json and all dependencies, copies assets and an index.ts game script into your project.
41
- ```bash
42
- # Option 1: Initialize a boilerplate project
43
- bunx hytopia init
44
-
45
- # Option 2: Initialize a project from any of the examples in the examples directory like so:
46
- bunx hytopia init --template payload-game
47
- ```
48
-
49
- 3. Start the server, use --watch for hot reloads as you make changes.
50
- ```bash
51
- bun --watch index.ts
52
- ```
53
-
54
- 4. Visit https://play.hytopia.com - when prompted, enter `localhost:8080` - this is the hostname of the local server you started in the previous step.
55
-
56
- **Note: If you'd prefer to use JavaScript instead of TypeScript, simply change the file extension of index.ts to index.js - Your editor will highlight the TypeScript syntax errors, simple delete the type annotations and everything should work the same without any TypeScript usage.**
33
+ **[Follow the Initial Setup guide, here](https://dev.hytopia.com/getting-started/initial-setup).**
57
34
 
58
35
  Once you're up and running, here's some other resources to go further:
59
36
  - [Developer Docs](https://dev.hytopia.com/)
package/bin/scripts.js CHANGED
@@ -27,28 +27,34 @@ const path = require('path');
27
27
  if (command === 'init') {
28
28
  const destDir = process.cwd();
29
29
 
30
+ // Initialize project with latest HYTOPIA SDK
31
+ console.log('🔧 Initializing project with latest HYTOPIA SDK...');
32
+ execSync('bun init --yes');
33
+ execSync('bun add hytopia@latest');
34
+
30
35
  if (flags.template) {
31
- console.log(`🔧 Initializing project with examples template ${flags.template}`);
36
+ // Init from example template
37
+ console.log(`🖨️ Initializing project with examples template "${flags.template}"...`);
32
38
 
33
- const templateDir = path.join(__dirname, '..', 'examples', flags.template);
39
+ const templateDir = path.join(destDir, 'node_modules', 'hytopia', 'examples', flags.template);
34
40
 
35
41
  if (!fs.existsSync(templateDir)) {
36
- console.error(`Examples template ${flags.template} does not exist in the examples directory, could not initialize project!`);
42
+ console.error(`Examples template ${flags.template} does not exist in the examples directory, could not initialize project! Tried directory: ${templateDir}`);
37
43
  return;
38
44
  }
39
45
 
40
46
  fs.cpSync(templateDir, destDir, { recursive: true });
41
- execSync('bun install');
42
47
  } else {
43
- console.log('🔧 Initializing project');
44
- execSync('bun init --yes');
45
- execSync('bun add hytopia@latest');
46
-
48
+ // Init from boilerplate
49
+ console.log('🧑‍💻 Initializing project with boilerplate...');
50
+
47
51
  const srcDir = path.join(__dirname, '..', 'boilerplate');
52
+
48
53
  fs.cpSync(srcDir, destDir, { recursive: true });
49
54
  }
50
55
 
51
56
  // Done, lfg!
57
+ console.log('--------------------------------');
52
58
  console.log('🚀 Hytopia project initialized successfully!');
53
59
  console.log('💡 Start your development server with `bun --watch index.ts`!');
54
60
  console.log('🎮 After you start your development server, play by opening your browser and visiting: https://play.hytopia.com/?join=localhost:8080')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create multiplayer games on the HYTOPIA platform using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -1,14 +0,0 @@
1
- {
2
- "name": "character-controller",
3
- "module": "index.ts",
4
- "type": "module",
5
- "devDependencies": {
6
- "@types/bun": "latest"
7
- },
8
- "peerDependencies": {
9
- "typescript": "^5.0.0"
10
- },
11
- "dependencies": {
12
- "hytopia": "latest"
13
- }
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "entity-spawn",
3
- "module": "index.ts",
4
- "type": "module",
5
- "devDependencies": {
6
- "@types/bun": "latest"
7
- },
8
- "peerDependencies": {
9
- "typescript": "^5.0.0"
10
- },
11
- "dependencies": {
12
- "hytopia": "latest"
13
- }
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "entity-spawn",
3
- "module": "index.ts",
4
- "type": "module",
5
- "devDependencies": {
6
- "@types/bun": "latest"
7
- },
8
- "peerDependencies": {
9
- "typescript": "^5.0.0"
10
- },
11
- "dependencies": {
12
- "hytopia": "latest"
13
- }
14
- }