@hytopia.com/examples 1.0.33 → 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 (55) 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/assets/models/players/.optimized/player/player-named-nodes.bin +0 -0
  18. package/frontiers-rpg-game/assets/models/players/.optimized/player/player-named-nodes.gltf +14515 -7134
  19. package/frontiers-rpg-game/assets/models/players/.optimized/player/player.bin +0 -0
  20. package/frontiers-rpg-game/assets/models/players/.optimized/player/player.gltf +14035 -6702
  21. package/frontiers-rpg-game/assets/models/players/.optimized/player/player.gltf.md5 +1 -1
  22. package/frontiers-rpg-game/assets/models/players/player.gltf +1 -1
  23. package/frontiers-rpg-game/dev/persistence/player-player-1.json +1 -1
  24. package/frontiers-rpg-game/src/GameManager.ts +5 -5
  25. package/frontiers-rpg-game/src/items/ItemRegistry.ts +2 -2
  26. package/frontiers-rpg-game/src/quests/QuestRegistry.ts +2 -2
  27. package/frontiers-rpg-game/src/regions/chitter-forest/ChitterForestRegion.ts +1 -1
  28. package/frontiers-rpg-game/src/regions/hearthwilds/HearthwildsRegion.ts +1 -1
  29. package/frontiers-rpg-game/src/regions/ratkin-nest/RatkinNestRegion.ts +1 -1
  30. package/frontiers-rpg-game/src/regions/stalkhaven/StalkhavenRegion.ts +1 -1
  31. package/frontiers-rpg-game/src/regions/stalkhaven-port/StalkhavenPortRegion.ts +1 -1
  32. package/frontiers-rpg-game/src/regions/weavers-hollow/WeaversHollowRegion.ts +1 -1
  33. package/hole-in-wall-game/index.ts +1 -1
  34. package/hole-in-wall-game/package.json +1 -1
  35. package/hygrounds/classes/GameManager.ts +1 -1
  36. package/hygrounds/index.ts +1 -1
  37. package/hygrounds/package.json +1 -1
  38. package/lighting/index.ts +1 -1
  39. package/lighting/package.json +1 -1
  40. package/mobile-controls/index.ts +1 -1
  41. package/mobile-controls/package.json +1 -1
  42. package/package.json +1 -1
  43. package/particles/index.ts +7 -1
  44. package/pathfinding/index.ts +1 -1
  45. package/pathfinding/package.json +1 -1
  46. package/payload-game/index.ts +1 -1
  47. package/payload-game/package.json +1 -1
  48. package/player-persistence/index.ts +1 -1
  49. package/player-persistence/package.json +1 -1
  50. package/wall-dodge-game/index.ts +1 -1
  51. package/wall-dodge-game/package.json +1 -1
  52. package/world-switching/index.ts +2 -2
  53. package/world-switching/package.json +1 -1
  54. package/zombies-fps/index.ts +1 -1
  55. package/zombies-fps/package.json +1 -1
@@ -10,7 +10,7 @@
10
10
  "skillExperience": [
11
11
  [
12
12
  "agility",
13
- 4
13
+ 8
14
14
  ]
15
15
  ],
16
16
  "backpack": {
@@ -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
 
@@ -51,7 +51,7 @@ export default class GameManager {
51
51
  const hearthwildsRegion = new HearthwildsRegion();
52
52
  this._regions.set(hearthwildsRegion.id, hearthwildsRegion);
53
53
  GameClock.instance.addRegionClockCycle(hearthwildsRegion);
54
- this._startRegion = hearthwildsRegion;
54
+ // this._startRegion = hearthwildsRegion;
55
55
 
56
56
  // Ratkin Nest
57
57
  const ratkinNestRegion = new RatkinNestRegion();
@@ -67,7 +67,7 @@ export default class GameManager {
67
67
  const stalkhavenPortRegion = new StalkhavenPortRegion();
68
68
  this._regions.set(stalkhavenPortRegion.id, stalkhavenPortRegion);
69
69
  GameClock.instance.addRegionClockCycle(stalkhavenPortRegion);
70
- // this._startRegion = stalkhavenPortRegion;
70
+ this._startRegion = stalkhavenPortRegion;
71
71
 
72
72
  // Weaver's Hollow
73
73
  const weaversHollowRegion = new WeaversHollowRegion();
@@ -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.33",
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);
@@ -45,6 +45,7 @@ startServer(world => {
45
45
  velocityVariance: { x: 4, y: 2, z: 4 }, // Variates the base velocity +/- this value
46
46
  });
47
47
  dirtParticleEmitter.spawn(world);
48
+ dirtParticleEmitter.stop();
48
49
 
49
50
  // Start/stop the emitter every 3 seconds
50
51
  setInterval(() => {
@@ -55,6 +56,11 @@ startServer(world => {
55
56
  }
56
57
  }, 5000);
57
58
 
59
+ // Burst every 1 second, regardless of pause state
60
+ setInterval(() => {
61
+ dirtParticleEmitter.burst(500);
62
+ }, 3000);
63
+
58
64
 
59
65
  // Falling sparkles emitter
60
66
  const fallingSparklesEmitter = new ParticleEmitter({
@@ -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",