a-maze-ing
This commit is contained in:
@@ -48,6 +48,7 @@ class InteractiveObject {
|
||||
resolve(mesh);
|
||||
break;
|
||||
case 'gltf':
|
||||
console.log('loadingg', obj.value)
|
||||
new GLTFLoader().load(obj.value, (gltf) => {
|
||||
let gltfObj = gltf.scene;
|
||||
gltf.scene.traverse(function (object) {
|
||||
|
||||
@@ -126,7 +126,8 @@ class MazeObject {
|
||||
|
||||
addRoom(['floor', 'door', def.r ? 'door' : 'wall', def.f ? 'door' : 'wall', def.l ? 'door' : 'wall'], def, offsetZ)
|
||||
|
||||
def.objects && def.objects.forEach(async obj => {
|
||||
console.log('loadingggg', def.objects)
|
||||
def.objects?.forEach(async obj => {
|
||||
obj.room = room;
|
||||
// let go = new GameObject(obj, context);
|
||||
let go = new InteractiveObject(obj, context)
|
||||
|
||||
@@ -30,7 +30,16 @@ class MazeQuizGame {
|
||||
|
||||
generate(questions, idx = 0, len){
|
||||
let cq = questions[idx]
|
||||
if (!cq) return {};
|
||||
if (!cq) return {
|
||||
len:3,
|
||||
objects:[
|
||||
{
|
||||
type: 'gltf',
|
||||
position:[0,.25,len + .52], scale: [0.037, 0.037, 0.037], rotation: [0, Math.PI/4, 0],
|
||||
value: '/static/meshes/award.glb'
|
||||
}
|
||||
]
|
||||
};
|
||||
len = len || Math.round(Math.random()*tl) + 2;
|
||||
|
||||
// let l = {
|
||||
@@ -64,7 +73,7 @@ class MazeQuizGame {
|
||||
}
|
||||
if (i == 0){
|
||||
mo[d] = {
|
||||
len: 4,
|
||||
len: 3,
|
||||
[dd]: this.generate(questions, idx + 1, 3)
|
||||
}
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user