hytopia 0.1.24 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- package/boilerplate/index.ts +12 -0
- package/examples/character-controller/index.ts +1 -2
- package/examples/entity-spawn/index.ts +1 -2
- package/package.json +1 -1
- package/bun.lockb +0 -0
- package/examples/character-controller/bun.lockb +0 -0
- package/examples/entity-spawn/bun.lockb +0 -0
- package/examples/payload-game/bun.lockb +0 -0
package/boilerplate/index.ts
CHANGED
@@ -25,6 +25,7 @@
|
|
25
25
|
|
26
26
|
import {
|
27
27
|
startServer,
|
28
|
+
Audio,
|
28
29
|
GameServer,
|
29
30
|
PlayerEntity,
|
30
31
|
} from 'hytopia';
|
@@ -112,4 +113,15 @@ startServer(world => {
|
|
112
113
|
entity.applyImpulse({ x: 0, y: 20, z: 0 });
|
113
114
|
});
|
114
115
|
});
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Play some peaceful ambient music to
|
119
|
+
* set the mood!
|
120
|
+
*/
|
121
|
+
|
122
|
+
new Audio({
|
123
|
+
uri: 'audio/music/overworld.mp3',
|
124
|
+
loop: true,
|
125
|
+
volume: 0.1,
|
126
|
+
}).play(world);
|
115
127
|
});
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import {
|
2
2
|
startServer,
|
3
|
-
GameServer,
|
4
3
|
PlayerEntity,
|
5
4
|
} from 'hytopia';
|
6
5
|
|
@@ -29,7 +28,7 @@ startServer(world => {
|
|
29
28
|
console.log('Creating custom player entity character controller...');
|
30
29
|
|
31
30
|
return new MyCharacterController(playerEntity);
|
32
|
-
}
|
31
|
+
};
|
33
32
|
|
34
33
|
playerEntity.spawn(world, { x: 0, y: 10, z: 0 });
|
35
34
|
console.log('Spawned player entity!');
|
@@ -2,7 +2,6 @@ import {
|
|
2
2
|
startServer,
|
3
3
|
ColliderShape,
|
4
4
|
Entity,
|
5
|
-
GameServer,
|
6
5
|
PlayerEntity,
|
7
6
|
RigidBodyType,
|
8
7
|
World,
|
@@ -50,7 +49,7 @@ startServer(world => {
|
|
50
49
|
onCollision: (otherEntity, started) => {
|
51
50
|
console.log('spider aggro-sensor colliding with', otherEntity.name, started);
|
52
51
|
},
|
53
|
-
}
|
52
|
+
},
|
54
53
|
],
|
55
54
|
rotation: { x: 0, y: 0.4, z: 0, w: 0.6 }, // rotations are provided as a quaternion
|
56
55
|
},
|
package/package.json
CHANGED
package/bun.lockb
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|