hytopia 0.1.85 → 0.1.87
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/examples/ai-agents/index.ts +1 -1
- package/examples/ai-agents/package.json +2 -2
- package/examples/big-world/assets/map.json +34 -33
- package/examples/big-world/index.ts +1 -1
- package/examples/big-world/package.json +2 -2
- package/examples/block-entity/assets/map.json +33 -33
- package/examples/block-entity/index.ts +7 -7
- package/examples/block-entity/package.json +2 -2
- package/examples/child-entity/assets/map.json +33 -33
- package/examples/child-entity/index.ts +2 -2
- package/examples/child-entity/package.json +2 -2
- package/examples/custom-ui/assets/map.json +33 -33
- package/examples/custom-ui/index.ts +2 -2
- package/examples/custom-ui/package.json +2 -2
- package/examples/entity-controller/MyEntityController.ts +1 -1
- package/examples/entity-controller/assets/map.json +33 -33
- package/examples/entity-controller/index.ts +1 -1
- package/examples/entity-spawn/assets/map.json +33 -33
- package/examples/entity-spawn/index.ts +3 -3
- package/examples/entity-spawn/package.json +2 -2
- package/examples/hole-in-wall-game/assets/map.json +32 -32
- package/examples/hole-in-wall-game/index.ts +5 -5
- package/examples/hole-in-wall-game/package.json +2 -2
- package/examples/lighting/assets/map.json +33 -33
- package/examples/lighting/index.ts +2 -2
- package/examples/lighting/package.json +2 -2
- package/examples/payload-game/assets/map.json +33 -33
- package/examples/payload-game/index.ts +2 -2
- package/examples/payload-game/package.json +2 -2
- package/examples/wall-dodge-game/assets/map.json +32 -32
- package/examples/wall-dodge-game/index.ts +9 -9
- package/examples/wall-dodge-game/package.json +2 -2
- package/package.json +1 -1
- package/server.js +1 -1
- /package/examples/hole-in-wall-game/assets/{textures → blocks}/water.png +0 -0
@@ -3,112 +3,112 @@
|
|
3
3
|
{
|
4
4
|
"id": 1,
|
5
5
|
"name": "bricks",
|
6
|
-
"textureUri": "
|
6
|
+
"textureUri": "blocks/bricks.png"
|
7
7
|
},
|
8
8
|
{
|
9
9
|
"id": 2,
|
10
10
|
"name": "clay",
|
11
|
-
"textureUri": "
|
11
|
+
"textureUri": "blocks/clay.png"
|
12
12
|
},
|
13
13
|
{
|
14
14
|
"id": 3,
|
15
|
-
"name": "
|
16
|
-
"textureUri": "
|
15
|
+
"name": "diamond-ore",
|
16
|
+
"textureUri": "blocks/diamond-ore.png"
|
17
17
|
},
|
18
18
|
{
|
19
19
|
"id": 4,
|
20
20
|
"name": "dirt",
|
21
|
-
"textureUri": "
|
21
|
+
"textureUri": "blocks/dirt.png"
|
22
22
|
},
|
23
23
|
{
|
24
24
|
"id": 5,
|
25
|
-
"name": "
|
26
|
-
"textureUri": "
|
25
|
+
"name": "dragons-stone",
|
26
|
+
"textureUri": "blocks/dragons-stone.png"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"id": 6,
|
30
30
|
"name": "glass",
|
31
|
-
"textureUri": "
|
31
|
+
"textureUri": "blocks/glass.png"
|
32
32
|
},
|
33
33
|
{
|
34
34
|
"id": 7,
|
35
35
|
"name": "grass",
|
36
|
-
"textureUri": "
|
36
|
+
"textureUri": "blocks/grass"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
"id": 8,
|
40
40
|
"name": "gravel",
|
41
|
-
"textureUri": "
|
41
|
+
"textureUri": "blocks/gravel.png"
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"id": 9,
|
45
45
|
"name": "ice",
|
46
|
-
"textureUri": "
|
46
|
+
"textureUri": "blocks/ice.png"
|
47
47
|
},
|
48
48
|
{
|
49
49
|
"id": 10,
|
50
|
-
"name": "
|
51
|
-
"textureUri": "
|
50
|
+
"name": "infected-shadowrock",
|
51
|
+
"textureUri": "blocks/infected-shadowrock.png"
|
52
52
|
},
|
53
53
|
{
|
54
54
|
"id": 11,
|
55
|
-
"name": "
|
56
|
-
"textureUri": "
|
55
|
+
"name": "log-side",
|
56
|
+
"textureUri": "blocks/log"
|
57
57
|
},
|
58
58
|
{
|
59
59
|
"id": 12,
|
60
|
-
"name": "
|
61
|
-
"textureUri": "
|
60
|
+
"name": "log-top",
|
61
|
+
"textureUri": "blocks/log"
|
62
62
|
},
|
63
63
|
{
|
64
64
|
"id": 13,
|
65
|
-
"name": "
|
66
|
-
"textureUri": "
|
65
|
+
"name": "mossy-coblestone",
|
66
|
+
"textureUri": "blocks/mossy-coblestone.png"
|
67
67
|
},
|
68
68
|
{
|
69
69
|
"id": 14,
|
70
70
|
"name": "nuit",
|
71
|
-
"textureUri": "
|
71
|
+
"textureUri": "blocks/nuit.png"
|
72
72
|
},
|
73
73
|
{
|
74
74
|
"id": 15,
|
75
|
-
"name": "
|
76
|
-
"textureUri": "
|
75
|
+
"name": "oak-leaves",
|
76
|
+
"textureUri": "blocks/oak-leaves.png"
|
77
77
|
},
|
78
78
|
{
|
79
79
|
"id": 16,
|
80
|
-
"name": "
|
81
|
-
"textureUri": "
|
80
|
+
"name": "oak-planks",
|
81
|
+
"textureUri": "blocks/oak-planks.png"
|
82
82
|
},
|
83
83
|
{
|
84
84
|
"id": 17,
|
85
85
|
"name": "sand",
|
86
|
-
"textureUri": "
|
86
|
+
"textureUri": "blocks/sand.png"
|
87
87
|
},
|
88
88
|
{
|
89
89
|
"id": 18,
|
90
90
|
"name": "shadowrock",
|
91
|
-
"textureUri": "
|
91
|
+
"textureUri": "blocks/shadowrock.png"
|
92
92
|
},
|
93
93
|
{
|
94
94
|
"id": 19,
|
95
95
|
"name": "stone",
|
96
|
-
"textureUri": "
|
96
|
+
"textureUri": "blocks/stone.png"
|
97
97
|
},
|
98
98
|
{
|
99
99
|
"id": 20,
|
100
|
-
"name": "
|
101
|
-
"textureUri": "
|
100
|
+
"name": "stone-bricks",
|
101
|
+
"textureUri": "blocks/stone-bricks.png"
|
102
102
|
},
|
103
103
|
{
|
104
104
|
"id": 21,
|
105
|
-
"name": "
|
106
|
-
"textureUri": "
|
105
|
+
"name": "void-sand",
|
106
|
+
"textureUri": "blocks/void-sand.png"
|
107
107
|
},
|
108
108
|
{
|
109
109
|
"id": 22,
|
110
110
|
"name": "water",
|
111
|
-
"textureUri": "
|
111
|
+
"textureUri": "blocks/water.png",
|
112
112
|
"isLiquid": true
|
113
113
|
}
|
114
114
|
],
|
@@ -63,13 +63,13 @@ let gameUiState: object = {};
|
|
63
63
|
|
64
64
|
// Audio
|
65
65
|
const gameActiveAudio = new Audio({
|
66
|
-
uri: 'audio/music.mp3',
|
66
|
+
uri: 'audio/music/hytopia-main.mp3',
|
67
67
|
loop: true,
|
68
68
|
volume: 0.2,
|
69
69
|
});
|
70
70
|
|
71
71
|
const gameInactiveAudio = new Audio({
|
72
|
-
uri: 'audio/music/
|
72
|
+
uri: 'audio/music/hytopia-main.mp3',
|
73
73
|
loop: true,
|
74
74
|
volume: 0.2,
|
75
75
|
});
|
@@ -90,7 +90,7 @@ function onPlayerJoin(world: World, player: Player) {
|
|
90
90
|
const playerEntity = new PlayerEntity({
|
91
91
|
player,
|
92
92
|
name: 'Player',
|
93
|
-
modelUri: 'models/player.gltf',
|
93
|
+
modelUri: 'models/players/player.gltf',
|
94
94
|
modelLoopedAnimations: ['idle'],
|
95
95
|
modelScale: 0.5,
|
96
96
|
});
|
@@ -125,7 +125,7 @@ function onPlayerLeave(world: World, player: Player) {
|
|
125
125
|
function spawnJoinNpc(world: World) {
|
126
126
|
const joinNpc = new Entity({
|
127
127
|
name: 'Join NPC',
|
128
|
-
modelUri: 'models/mindflayer.gltf',
|
128
|
+
modelUri: 'models/npcs/mindflayer.gltf',
|
129
129
|
modelLoopedAnimations: ['idle'],
|
130
130
|
modelScale: 0.4,
|
131
131
|
rigidBodyOptions: {
|
@@ -133,7 +133,7 @@ function spawnJoinNpc(world: World) {
|
|
133
133
|
enabledPositions: { x: false, y: true, z: false },
|
134
134
|
enabledRotations: { x: false, y: true, z: false },
|
135
135
|
colliders: [
|
136
|
-
Collider.optionsFromModelUri('models/mindflayer.gltf', 0.4),
|
136
|
+
Collider.optionsFromModelUri('models/npcs/mindflayer.gltf', 0.4),
|
137
137
|
{
|
138
138
|
shape: ColliderShape.CYLINDER,
|
139
139
|
radius: 2,
|
@@ -3,112 +3,112 @@
|
|
3
3
|
{
|
4
4
|
"id": 1,
|
5
5
|
"name": "bricks",
|
6
|
-
"textureUri": "
|
6
|
+
"textureUri": "blocks/bricks.png"
|
7
7
|
},
|
8
8
|
{
|
9
9
|
"id": 2,
|
10
10
|
"name": "clay",
|
11
|
-
"textureUri": "
|
11
|
+
"textureUri": "blocks/clay.png"
|
12
12
|
},
|
13
13
|
{
|
14
14
|
"id": 3,
|
15
|
-
"name": "
|
16
|
-
"textureUri": "
|
15
|
+
"name": "diamond-ore",
|
16
|
+
"textureUri": "blocks/diamond-ore.png"
|
17
17
|
},
|
18
18
|
{
|
19
19
|
"id": 4,
|
20
20
|
"name": "dirt",
|
21
|
-
"textureUri": "
|
21
|
+
"textureUri": "blocks/dirt.png"
|
22
22
|
},
|
23
23
|
{
|
24
24
|
"id": 5,
|
25
|
-
"name": "
|
26
|
-
"textureUri": "
|
25
|
+
"name": "dragons-stone",
|
26
|
+
"textureUri": "blocks/dragons-stone.png"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"id": 6,
|
30
30
|
"name": "glass",
|
31
|
-
"textureUri": "
|
31
|
+
"textureUri": "blocks/glass.png"
|
32
32
|
},
|
33
33
|
{
|
34
34
|
"id": 7,
|
35
35
|
"name": "grass",
|
36
|
-
"textureUri": "
|
36
|
+
"textureUri": "blocks/grass"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
"id": 8,
|
40
40
|
"name": "gravel",
|
41
|
-
"textureUri": "
|
41
|
+
"textureUri": "blocks/gravel.png"
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"id": 9,
|
45
45
|
"name": "ice",
|
46
|
-
"textureUri": "
|
46
|
+
"textureUri": "blocks/ice.png"
|
47
47
|
},
|
48
48
|
{
|
49
49
|
"id": 10,
|
50
|
-
"name": "
|
51
|
-
"textureUri": "
|
50
|
+
"name": "infected-shadowrock",
|
51
|
+
"textureUri": "blocks/infected-shadowrock.png"
|
52
52
|
},
|
53
53
|
{
|
54
54
|
"id": 11,
|
55
|
-
"name": "
|
56
|
-
"textureUri": "
|
55
|
+
"name": "log-side",
|
56
|
+
"textureUri": "blocks/log"
|
57
57
|
},
|
58
58
|
{
|
59
59
|
"id": 12,
|
60
|
-
"name": "
|
61
|
-
"textureUri": "
|
60
|
+
"name": "log-top",
|
61
|
+
"textureUri": "blocks/log"
|
62
62
|
},
|
63
63
|
{
|
64
64
|
"id": 13,
|
65
|
-
"name": "
|
66
|
-
"textureUri": "
|
65
|
+
"name": "mossy-coblestone",
|
66
|
+
"textureUri": "blocks/mossy-coblestone.png"
|
67
67
|
},
|
68
68
|
{
|
69
69
|
"id": 14,
|
70
70
|
"name": "nuit",
|
71
|
-
"textureUri": "
|
71
|
+
"textureUri": "blocks/nuit.png"
|
72
72
|
},
|
73
73
|
{
|
74
74
|
"id": 15,
|
75
|
-
"name": "
|
76
|
-
"textureUri": "
|
75
|
+
"name": "oak-leaves",
|
76
|
+
"textureUri": "blocks/oak-leaves.png"
|
77
77
|
},
|
78
78
|
{
|
79
79
|
"id": 16,
|
80
|
-
"name": "
|
81
|
-
"textureUri": "
|
80
|
+
"name": "oak-planks",
|
81
|
+
"textureUri": "blocks/oak-planks.png"
|
82
82
|
},
|
83
83
|
{
|
84
84
|
"id": 17,
|
85
85
|
"name": "sand",
|
86
|
-
"textureUri": "
|
86
|
+
"textureUri": "blocks/sand.png"
|
87
87
|
},
|
88
88
|
{
|
89
89
|
"id": 18,
|
90
90
|
"name": "shadowrock",
|
91
|
-
"textureUri": "
|
91
|
+
"textureUri": "blocks/shadowrock.png"
|
92
92
|
},
|
93
93
|
{
|
94
94
|
"id": 19,
|
95
95
|
"name": "stone",
|
96
|
-
"textureUri": "
|
96
|
+
"textureUri": "blocks/stone.png"
|
97
97
|
},
|
98
98
|
{
|
99
99
|
"id": 20,
|
100
|
-
"name": "
|
101
|
-
"textureUri": "
|
100
|
+
"name": "stone-bricks",
|
101
|
+
"textureUri": "blocks/stone-bricks.png"
|
102
102
|
},
|
103
103
|
{
|
104
104
|
"id": 21,
|
105
|
-
"name": "
|
106
|
-
"textureUri": "
|
105
|
+
"name": "void-sand",
|
106
|
+
"textureUri": "blocks/void-sand.png"
|
107
107
|
},
|
108
108
|
{
|
109
109
|
"id": 22,
|
110
|
-
"name": "
|
111
|
-
"textureUri": "
|
110
|
+
"name": "water-still",
|
111
|
+
"textureUri": "blocks/water-still.png",
|
112
112
|
"isLiquid": true
|
113
113
|
}
|
114
114
|
],
|
@@ -87,7 +87,7 @@ startServer(world => {
|
|
87
87
|
const playerEntity = new PlayerEntity({
|
88
88
|
player,
|
89
89
|
name: 'Player',
|
90
|
-
modelUri: 'models/player.gltf',
|
90
|
+
modelUri: 'models/players/player.gltf',
|
91
91
|
modelLoopedAnimations: [ 'idle' ],
|
92
92
|
modelScale: 0.5,
|
93
93
|
});
|
@@ -114,7 +114,7 @@ startServer(world => {
|
|
114
114
|
|
115
115
|
// Play some music on game start
|
116
116
|
(new Audio({
|
117
|
-
uri: 'audio/music/cave.mp3',
|
117
|
+
uri: 'audio/music/cave-theme.mp3',
|
118
118
|
loop: true,
|
119
119
|
})).play(world);
|
120
120
|
});
|
@@ -3,112 +3,112 @@
|
|
3
3
|
{
|
4
4
|
"id": 1,
|
5
5
|
"name": "bricks",
|
6
|
-
"textureUri": "
|
6
|
+
"textureUri": "blocks/bricks.png"
|
7
7
|
},
|
8
8
|
{
|
9
9
|
"id": 2,
|
10
10
|
"name": "clay",
|
11
|
-
"textureUri": "
|
11
|
+
"textureUri": "blocks/clay.png"
|
12
12
|
},
|
13
13
|
{
|
14
14
|
"id": 3,
|
15
|
-
"name": "
|
16
|
-
"textureUri": "
|
15
|
+
"name": "diamond-ore",
|
16
|
+
"textureUri": "blocks/diamond-ore.png"
|
17
17
|
},
|
18
18
|
{
|
19
19
|
"id": 4,
|
20
20
|
"name": "dirt",
|
21
|
-
"textureUri": "
|
21
|
+
"textureUri": "blocks/dirt.png"
|
22
22
|
},
|
23
23
|
{
|
24
24
|
"id": 5,
|
25
|
-
"name": "
|
26
|
-
"textureUri": "
|
25
|
+
"name": "dragons-stone",
|
26
|
+
"textureUri": "blocks/dragons-stone.png"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"id": 6,
|
30
30
|
"name": "glass",
|
31
|
-
"textureUri": "
|
31
|
+
"textureUri": "blocks/glass.png"
|
32
32
|
},
|
33
33
|
{
|
34
34
|
"id": 7,
|
35
35
|
"name": "grass",
|
36
|
-
"textureUri": "
|
36
|
+
"textureUri": "blocks/grass"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
"id": 8,
|
40
40
|
"name": "gravel",
|
41
|
-
"textureUri": "
|
41
|
+
"textureUri": "blocks/gravel.png"
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"id": 9,
|
45
45
|
"name": "ice",
|
46
|
-
"textureUri": "
|
46
|
+
"textureUri": "blocks/ice.png"
|
47
47
|
},
|
48
48
|
{
|
49
49
|
"id": 10,
|
50
|
-
"name": "
|
51
|
-
"textureUri": "
|
50
|
+
"name": "infected-shadowrock",
|
51
|
+
"textureUri": "blocks/infected-shadowrock.png"
|
52
52
|
},
|
53
53
|
{
|
54
54
|
"id": 11,
|
55
|
-
"name": "
|
56
|
-
"textureUri": "
|
55
|
+
"name": "log-side",
|
56
|
+
"textureUri": "blocks/log"
|
57
57
|
},
|
58
58
|
{
|
59
59
|
"id": 12,
|
60
|
-
"name": "
|
61
|
-
"textureUri": "
|
60
|
+
"name": "log-top",
|
61
|
+
"textureUri": "blocks/log"
|
62
62
|
},
|
63
63
|
{
|
64
64
|
"id": 13,
|
65
|
-
"name": "
|
66
|
-
"textureUri": "
|
65
|
+
"name": "mossy-coblestone",
|
66
|
+
"textureUri": "blocks/mossy-coblestone.png"
|
67
67
|
},
|
68
68
|
{
|
69
69
|
"id": 14,
|
70
70
|
"name": "nuit",
|
71
|
-
"textureUri": "
|
71
|
+
"textureUri": "blocks/nuit.png"
|
72
72
|
},
|
73
73
|
{
|
74
74
|
"id": 15,
|
75
|
-
"name": "
|
76
|
-
"textureUri": "
|
75
|
+
"name": "oak-leaves",
|
76
|
+
"textureUri": "blocks/oak-leaves.png"
|
77
77
|
},
|
78
78
|
{
|
79
79
|
"id": 16,
|
80
|
-
"name": "
|
81
|
-
"textureUri": "
|
80
|
+
"name": "oak-planks",
|
81
|
+
"textureUri": "blocks/oak-planks.png"
|
82
82
|
},
|
83
83
|
{
|
84
84
|
"id": 17,
|
85
85
|
"name": "sand",
|
86
|
-
"textureUri": "
|
86
|
+
"textureUri": "blocks/sand.png"
|
87
87
|
},
|
88
88
|
{
|
89
89
|
"id": 18,
|
90
90
|
"name": "shadowrock",
|
91
|
-
"textureUri": "
|
91
|
+
"textureUri": "blocks/shadowrock.png"
|
92
92
|
},
|
93
93
|
{
|
94
94
|
"id": 19,
|
95
95
|
"name": "stone",
|
96
|
-
"textureUri": "
|
96
|
+
"textureUri": "blocks/stone.png"
|
97
97
|
},
|
98
98
|
{
|
99
99
|
"id": 20,
|
100
|
-
"name": "
|
101
|
-
"textureUri": "
|
100
|
+
"name": "stone-bricks",
|
101
|
+
"textureUri": "blocks/stone-bricks.png"
|
102
102
|
},
|
103
103
|
{
|
104
104
|
"id": 21,
|
105
|
-
"name": "
|
106
|
-
"textureUri": "
|
105
|
+
"name": "void-sand",
|
106
|
+
"textureUri": "blocks/void-sand.png"
|
107
107
|
},
|
108
108
|
{
|
109
109
|
"id": 22,
|
110
|
-
"name": "
|
111
|
-
"textureUri": "
|
110
|
+
"name": "water-still",
|
111
|
+
"textureUri": "blocks/water-still.png"
|
112
112
|
}
|
113
113
|
],
|
114
114
|
"blocks": {
|
@@ -336,7 +336,7 @@ function spawnSpider(world: World, coordinate: Vector3Like) {
|
|
336
336
|
const spider = new Entity({
|
337
337
|
controller: new SimpleEntityController(),
|
338
338
|
name: 'Spider',
|
339
|
-
modelUri: 'models/spider.gltf',
|
339
|
+
modelUri: 'models/npcs/spider.gltf',
|
340
340
|
modelLoopedAnimations: [ 'walk' ],
|
341
341
|
modelScale: baseScale * randomScaleMultiplier,
|
342
342
|
rigidBodyOptions: {
|
@@ -344,7 +344,7 @@ function spawnSpider(world: World, coordinate: Vector3Like) {
|
|
344
344
|
enabledRotations: { x: false, y: true, z: false },
|
345
345
|
colliders: [
|
346
346
|
// Get hitbox collider as collider options based on the model & scale.
|
347
|
-
Collider.optionsFromModelUri('models/spider.gltf', baseScale * randomScaleMultiplier),
|
347
|
+
Collider.optionsFromModelUri('models/npcs/spider.gltf', baseScale * randomScaleMultiplier),
|
348
348
|
{
|
349
349
|
shape: ColliderShape.CYLINDER,
|
350
350
|
radius: 20,
|