This commit is contained in:
2026-03-23 19:56:37 +02:00
parent 45074d78d2
commit 627452a308
4 changed files with 15 additions and 21 deletions
@@ -43,8 +43,8 @@ class MazeQuizGame extends EventManager {
super();
this.data = data;
data.noPhysics = true;
params.mazeFile = data.style || 'quiz-s2.gltf';
params.io = this;
this.params = { ...params, mazeFile: data.style || 'quiz-s2.gltf', io: this }
this.maxPoints = (data.points || 0) + (data.questionPoints||0) * data.questions.length;
this.minPoints = this.maxPoints - (data.questionPenalty||0) * data.questions.length;
@@ -52,7 +52,7 @@ class MazeQuizGame extends EventManager {
return new Promise(async (resolve, reject)=>{
let questions = data.shuffle ? Utils.shuffleArray(data.questions) : data.questions;
let def = this.generate(questions);
this.mazeObject = new MazeObject(engine, def, params)
this.mazeObject = new MazeObject(engine, def, this.params)
engine.addEventListener('collision', async e=>{
let ud1 = engine.physics.world.getCollider(e.handle1)?.parent()?.userData,
ud2 = engine.physics.world.getCollider(e.handle2)?.parent()?.userData;
@@ -124,7 +124,7 @@ class MazeQuizGame extends EventManager {
{
type: 'SceneSwitcher', switchScene: this.data.switchScene, switchType: this.data.switchType,
position:[0,.22,len + .52], scale: [0.33, 0.33, 0.33],
distance: params.wallSize*4
distance: this.params.wallSize*4
}
]
};