hytopia 0.1.62 → 0.1.64

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.
package/bin/scripts.js CHANGED
@@ -27,6 +27,11 @@ const path = require('path');
27
27
  if (command === 'init') {
28
28
  const destDir = process.cwd();
29
29
 
30
+ // Grab the latest dependencies
31
+ execSync('bun init --yes');
32
+ execSync('bun add hytopia@latest');
33
+ execSync('bun add @hytopia.com/assets');
34
+
30
35
  // Initialize project with latest HYTOPIA SDK
31
36
  console.log('🔧 Initializing project with latest HYTOPIA SDK...');
32
37
 
@@ -45,10 +50,6 @@ const path = require('path');
45
50
 
46
51
  execSync('bun install');
47
52
  } else {
48
- execSync('bun init --yes');
49
- execSync('bun add hytopia@latest');
50
- execSync('bun add @hytopia.com/assets');
51
-
52
53
  // Init from boilerplate
53
54
  console.log('🧑‍💻 Initializing project with boilerplate...');
54
55
 
@@ -180,7 +180,13 @@ function startBlockSpawner(world: World) {
180
180
 
181
181
  blockEntity.onTick = () => {
182
182
  if (blockEntity.isSpawned && blockEntity.position.z > GAME_BLOCK_DESPAWN_Z) {
183
- // TODO: drop it out of the world, despawn to fix platform collision bug
183
+ // Make it "fall" out of the world for a nice effect and prevent
184
+ // player collision platforming sensors from not getting their off
185
+ // event triggered because of despawning before uncontact.
186
+ blockEntity.setLinearVelocity({ x: 0, y: -5, z: 0 });
187
+ }
188
+
189
+ if (blockEntity.isSpawned && blockEntity.position.y < -5) {
184
190
  blockEntity.despawn();
185
191
  }
186
192
  };
@@ -260,8 +266,6 @@ function onPlayerJoin(world: World, player: Player) {
260
266
  modelScale: 0.5,
261
267
  });
262
268
 
263
- (playerEntity.controller as PlayerEntityController).sticksToPlatforms = false;
264
-
265
269
  playerEntity.onTick = () => {
266
270
  if (playerEntity.position.y < -3) {
267
271
  // Assume the player has fallen off the map in the game
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {