@hytopia.com/examples 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/ai-agents/index.ts +1 -1
  2. package/ai-agents/package.json +1 -1
  3. package/big-world/index.ts +1 -1
  4. package/big-world/package.json +1 -1
  5. package/block-entity/index.ts +1 -1
  6. package/block-entity/package.json +1 -1
  7. package/child-entity/index.ts +1 -1
  8. package/child-entity/package.json +1 -1
  9. package/custom-ui/index.ts +1 -1
  10. package/custom-ui/package.json +1 -1
  11. package/entity-animations/index.ts +1 -1
  12. package/entity-animations/package.json +1 -1
  13. package/entity-controller/index.ts +1 -1
  14. package/entity-controller/package.json +1 -1
  15. package/entity-spawn/index.ts +1 -1
  16. package/entity-spawn/package.json +1 -1
  17. package/frontiers-rpg-game/src/GameManager.ts +3 -3
  18. package/frontiers-rpg-game/src/items/ItemRegistry.ts +2 -2
  19. package/frontiers-rpg-game/src/quests/QuestRegistry.ts +2 -2
  20. package/frontiers-rpg-game/src/regions/chitter-forest/ChitterForestRegion.ts +1 -1
  21. package/frontiers-rpg-game/src/regions/hearthwilds/HearthwildsRegion.ts +1 -1
  22. package/frontiers-rpg-game/src/regions/ratkin-nest/RatkinNestRegion.ts +1 -1
  23. package/frontiers-rpg-game/src/regions/stalkhaven/StalkhavenRegion.ts +1 -1
  24. package/frontiers-rpg-game/src/regions/stalkhaven-port/StalkhavenPortRegion.ts +1 -1
  25. package/frontiers-rpg-game/src/regions/weavers-hollow/WeaversHollowRegion.ts +1 -1
  26. package/hole-in-wall-game/index.ts +1 -1
  27. package/hole-in-wall-game/package.json +1 -1
  28. package/hygrounds/classes/GameManager.ts +1 -1
  29. package/hygrounds/index.ts +1 -1
  30. package/hygrounds/package.json +1 -1
  31. package/lighting/index.ts +1 -1
  32. package/lighting/package.json +1 -1
  33. package/mobile-controls/index.ts +1 -1
  34. package/mobile-controls/package.json +1 -1
  35. package/package.json +1 -1
  36. package/particles/index.ts +1 -1
  37. package/pathfinding/index.ts +1 -1
  38. package/pathfinding/package.json +1 -1
  39. package/payload-game/index.ts +1 -1
  40. package/payload-game/package.json +1 -1
  41. package/player-persistence/index.ts +1 -1
  42. package/player-persistence/package.json +1 -1
  43. package/wall-dodge-game/index.ts +1 -1
  44. package/wall-dodge-game/package.json +1 -1
  45. package/world-switching/index.ts +2 -2
  46. package/world-switching/package.json +1 -1
  47. package/zombies-fps/index.ts +1 -1
  48. package/zombies-fps/package.json +1 -1
  49. /package/frontiers-rpg-game/assets/models/environment/{Skull-broken.gltf → skull-broken.gltf} +0 -0
  50. /package/frontiers-rpg-game/assets/models/environment/{Skull-flower.gltf → skull-flower.gltf} +0 -0
  51. /package/frontiers-rpg-game/assets/models/environment/{Skull.gltf → skull.gltf} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  Vector3,
33
33
  } from "hytopia";
34
34
 
35
- import worldMap from "./assets/map.json";
35
+ import worldMap from "./assets/map.json" with { type: "json" };
36
36
  import { FollowBehavior } from "./src/behaviors/FollowBehavior";
37
37
  import { BaseAgent } from "./src/BaseAgent";
38
38
  import { PathfindingBehavior } from "./src/behaviors/PathfindingBehavior";
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@hytopia.com/assets": "^0.3.2",
13
- "hytopia": "^0.6.4",
13
+ "hytopia": "*",
14
14
  "openai": "^4.77.3"
15
15
  },
16
16
  "trustedDependencies": [
@@ -4,7 +4,7 @@ import {
4
4
  PlayerEvent,
5
5
  } from 'hytopia';
6
6
 
7
- import worldMap from './assets/map.json';
7
+ import worldMap from './assets/map.json' with { type: 'json' } ;
8
8
 
9
9
  /**
10
10
  * This example loads and simulates extremely large map that is
@@ -10,7 +10,7 @@
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@hytopia.com/assets": "^0.3.2",
13
- "hytopia": "^0.6.4"
13
+ "hytopia": "*"
14
14
  },
15
15
  "trustedDependencies": [
16
16
  "mediasoup",
@@ -10,7 +10,7 @@ import {
10
10
  SimpleEntityController,
11
11
  } from 'hytopia';
12
12
 
13
- import worldMap from './assets/map.json';
13
+ import worldMap from './assets/map.json' with { type: 'json' } ;
14
14
 
15
15
  startServer(world => {
16
16
  // Boilerplate
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -6,7 +6,7 @@ import {
6
6
  Quaternion,
7
7
  } from 'hytopia';
8
8
 
9
- import worldMap from './assets/map.json';
9
+ import worldMap from './assets/map.json' with { type: 'json' } ;
10
10
 
11
11
  startServer(world => {
12
12
  world.loadMap(worldMap);
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -7,7 +7,7 @@ import {
7
7
  PlayerUIEvent,
8
8
  } from 'hytopia';
9
9
 
10
- import worldMap from './assets/map.json';
10
+ import worldMap from './assets/map.json' with { type: 'json' } ;
11
11
 
12
12
  // Simple map for player -> singular controlled entity
13
13
  const playerEntityMap = new Map<Player, DefaultPlayerEntity>();
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -5,7 +5,7 @@ import {
5
5
  ModelRegistry,
6
6
  } from 'hytopia';
7
7
 
8
- import worldMap from './assets/map.json';
8
+ import worldMap from './assets/map.json' with { type: 'json' } ;
9
9
 
10
10
  /**
11
11
  * This is a simple example used to visualize and debug animations.
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  import MyEntityController from './MyEntityController';
8
8
 
9
- import worldMap from './assets/map.json';
9
+ import worldMap from './assets/map.json' with { type: 'json' } ;
10
10
 
11
11
  startServer(world => {
12
12
  // Uncomment this to visualize physics vertices, will cause noticable lag.
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -11,7 +11,7 @@ import {
11
11
  World,
12
12
  } from 'hytopia';
13
13
 
14
- import worldMap from './assets/map.json';
14
+ import worldMap from './assets/map.json' with { type: 'json' } ;
15
15
 
16
16
  startServer(world => {
17
17
  // Boilerplate setup for our example, ignore this.
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -33,11 +33,11 @@ export default class GameManager {
33
33
  return this._regions.get(id);
34
34
  }
35
35
 
36
- public loadItems(): void {
37
- ItemRegistry.initializeItems();
36
+ public async loadItems(): Promise<void> {
37
+ await ItemRegistry.initializeItems();
38
38
  }
39
39
 
40
- public loadQuests(): void {
40
+ public async loadQuests(): Promise<void> {
41
41
  QuestRegistry.initializeQuests();
42
42
  }
43
43
 
@@ -9,10 +9,10 @@ export default class ItemRegistry {
9
9
  return this.itemRegistry.get(itemId);
10
10
  }
11
11
 
12
- public static initializeItems(): void {
12
+ public static async initializeItems(): Promise<void> {
13
13
  console.log('Loading items...');
14
14
 
15
- const ItemClasses = require('./ItemClasses').default; // lazy load to avoid circular dependencies
15
+ const ItemClasses = (await import('./ItemClasses')).default; // lazy load to avoid circular dependencies
16
16
  let loadedCount = 0;
17
17
 
18
18
  for (const ItemClass of ItemClasses) {
@@ -40,10 +40,10 @@ export default class QuestRegistry {
40
40
  return data?.interaction.enabledForInteractor(interactor) ? data.option : undefined;
41
41
  }
42
42
 
43
- public static initializeQuests(): void {
43
+ public static async initializeQuests(): Promise<void> {
44
44
  console.log('Loading quests...');
45
45
 
46
- const QuestClasses = require('./QuestClasses').default; // lazy load to avoid circular dependencies
46
+ const QuestClasses = (await import('./QuestClasses')).default; // lazy load to avoid circular dependencies
47
47
  const npcIdCounters = new Map<typeof BaseEntity, number>();
48
48
  let loadedCount = 0;
49
49
 
@@ -18,7 +18,7 @@ import RatkinWarriorEntity from '../../entities/enemies/RatkinWarriorEntity';
18
18
  // Spawner Forageables
19
19
  import RottenLogEntity from '../../entities/forageables/RottenLogEntity';
20
20
 
21
- import chitterForestMap from '../../../assets/maps/chitter-forest.json';
21
+ import chitterForestMap from '../../../assets/maps/chitter-forest.json' with { type: 'json' } ;
22
22
 
23
23
  export default class ChitterForestRegion extends GameRegion {
24
24
  public constructor() {
@@ -4,7 +4,7 @@ import Spawner from '../../systems/Spawner';
4
4
  import PortalEntity from '../../entities/PortalEntity';
5
5
  import type { WanderOptions } from '../../entities/BaseEntity';
6
6
 
7
- import hearthwildsMap from '../../../assets/maps/hearthwilds.json';
7
+ import hearthwildsMap from '../../../assets/maps/hearthwilds.json' with { type: 'json' } ;
8
8
 
9
9
  // NPCs
10
10
  import ArchivesBookshelf1Entity from './npcs/ArchivesBookshelf1Entity';
@@ -25,7 +25,7 @@ import WeaverBroodlingEntity from '../../entities/enemies/WeaverBroodlingEntity'
25
25
  // Spawner Forageables
26
26
  import DecayingPileEntity from '../../entities/forageables/DecayingPileEntity';
27
27
 
28
- import ratkinNestMap from '../../../assets/maps/ratkin-nest.json';
28
+ import ratkinNestMap from '../../../assets/maps/ratkin-nest.json' with { type: 'json' } ;
29
29
 
30
30
  export default class RatkinNestRegion extends GameRegion {
31
31
  public constructor() {
@@ -13,7 +13,7 @@ import BlacksmithArdenEntity from './npcs/BlacksmithArdenEntity';
13
13
  import HealerMycelisEntity from './npcs/HealerMycelisEntity';
14
14
  import MerchantFinnEntity from './npcs/MerchantFinnEntity';
15
15
 
16
- import stalkhavenMap from '../../../assets/maps/stalkhaven.json';
16
+ import stalkhavenMap from '../../../assets/maps/stalkhaven.json' with { type: 'json' } ;
17
17
 
18
18
  export default class StalkhavenRegion extends GameRegion {
19
19
  public constructor() {
@@ -4,7 +4,7 @@ import PortalEntity from '../../entities/PortalEntity';
4
4
  import BoatRepairmanSidEntity from './npcs/BoatRepairmanSidEntity';
5
5
  import PirateCaptainShroudEntity from './npcs/PirateCaptainShroudEntity';
6
6
 
7
- import stalkhavenPortMap from '../../../assets/maps/stalkhaven-port.json';
7
+ import stalkhavenPortMap from '../../../assets/maps/stalkhaven-port.json' with { type: 'json' } ;
8
8
 
9
9
  export default class StalkhavenRegion extends GameRegion {
10
10
  public constructor() {
@@ -3,7 +3,7 @@ import GameRegion from '../../GameRegion';
3
3
  import Spawner from '../../systems/Spawner';
4
4
  import PortalEntity from '../../entities/PortalEntity';
5
5
 
6
- import weaversHollowMap from '../../../assets/maps/weavers-hollow.json';
6
+ import weaversHollowMap from '../../../assets/maps/weavers-hollow.json' with { type: 'json' } ;
7
7
 
8
8
  import SpiderWebEntity from '../../entities/enemies/SpiderWebEntity';
9
9
  import QueenWeaverEntity from '../../entities/enemies/QueenWeaverEntity';
@@ -20,7 +20,7 @@ import {
20
20
 
21
21
  import GAME_WALL_SHAPES from './wall-shapes';
22
22
 
23
- import worldMap from './assets/map.json';
23
+ import worldMap from './assets/map.json' with { type: 'json' } ;
24
24
 
25
25
  // Game constants
26
26
  enum GameWallDirection {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -6,7 +6,7 @@ import {
6
6
  World,
7
7
  } from 'hytopia';
8
8
 
9
- import worldMap from '../assets/map.json';
9
+ import worldMap from '../assets/map.json' with { type: 'json' } ;
10
10
 
11
11
  import {
12
12
  BEDROCK_BLOCK_ID,
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  import GameManager from './classes/GameManager';
7
7
 
8
- import worldMap from './assets/map.json';
8
+ import worldMap from './assets/map.json' with { type: 'json' } ;
9
9
 
10
10
  startServer(world => {
11
11
  // Load the game map
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
package/lighting/index.ts CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  PlayerEvent,
8
8
  } from 'hytopia';
9
9
 
10
- import worldMap from './assets/map.json';
10
+ import worldMap from './assets/map.json' with { type: 'json' } ;
11
11
 
12
12
  startServer(world => {
13
13
  world.loadMap(worldMap);
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -4,7 +4,7 @@ import {
4
4
  PlayerEvent,
5
5
  } from 'hytopia';
6
6
 
7
- import worldMap from './assets/map.json';
7
+ import worldMap from './assets/map.json' with { type: 'json' } ;
8
8
 
9
9
  startServer(world => {
10
10
  world.loadMap(worldMap);
@@ -10,7 +10,7 @@
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@hytopia.com/assets": "^0.3.2",
13
- "hytopia": "^0.6.4"
13
+ "hytopia": "*"
14
14
  },
15
15
  "trustedDependencies": [
16
16
  "mediasoup",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/examples",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -7,7 +7,7 @@ import {
7
7
  Quaternion,
8
8
  } from 'hytopia';
9
9
 
10
- import worldMap from './assets/map.json';
10
+ import worldMap from './assets/map.json' with { type: 'json' } ;
11
11
 
12
12
  startServer(world => {
13
13
  world.loadMap(worldMap);
@@ -9,7 +9,7 @@ import {
9
9
  ColliderShape,
10
10
  } from 'hytopia';
11
11
 
12
- import worldMap from './assets/map.json';
12
+ import worldMap from './assets/map.json' with { type: 'json' } ;
13
13
 
14
14
  startServer(world => {
15
15
  world.loadMap(worldMap);
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -45,7 +45,7 @@ import type {
45
45
  EventPayloads,
46
46
  } from 'hytopia';
47
47
 
48
- import map from './assets/map.json';
48
+ import map from './assets/map.json' with { type: 'json' } ;
49
49
 
50
50
  // Constants
51
51
  const BULLET_SPEED = 50;
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -6,7 +6,7 @@ import {
6
6
  PersistenceManager,
7
7
  } from 'hytopia';
8
8
 
9
- import worldMap from './assets/map.json';
9
+ import worldMap from './assets/map.json' with { type: 'json' } ;
10
10
 
11
11
  startServer(world => {
12
12
  world.loadMap(worldMap);
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -18,7 +18,7 @@ import {
18
18
  DefaultPlayerEntityController,
19
19
  } from 'hytopia';
20
20
 
21
- import worldMap from './assets/map.json';
21
+ import worldMap from './assets/map.json' with { type: 'json' } ;
22
22
 
23
23
  const GAME_BLOCK_SIZE_RANGE = {
24
24
  x: [ 0.5, 4 ],
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -30,8 +30,8 @@ import {
30
30
  */
31
31
 
32
32
  // We'll use 2 maps in this example, 1 for each unique world.
33
- import world1Map from './assets/maps/world1.json';
34
- import world2Map from './assets/maps/world2.json';
33
+ import world1Map from './assets/maps/world1.json' with { type: 'json' } ;
34
+ import world2Map from './assets/maps/world2.json' with { type: 'json' } ;
35
35
 
36
36
  // The server always starts with a created default world passed in the startServer callback.
37
37
  startServer(defaultWorld => {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",
@@ -1,5 +1,5 @@
1
1
  import { startServer, PlayerEvent } from 'hytopia';
2
- import worldMap from './assets/maps/terrain.json';
2
+ import worldMap from './assets/maps/terrain.json' with { type: 'json' } ;
3
3
 
4
4
  import GameManager from './classes/GameManager';
5
5
 
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@hytopia.com/assets": "^0.3.2",
14
- "hytopia": "^0.6.4"
14
+ "hytopia": "*"
15
15
  },
16
16
  "trustedDependencies": [
17
17
  "mediasoup",