dashboard and progressbar
This commit is contained in:
@@ -245,6 +245,11 @@ export default {
|
||||
a: ['Миграционният път на птиците, минаващ покрай Бургаските езера', 'Рядък вид птица', 'Местност в гр. Бургас'],
|
||||
h: 'Грешен отговор. Via Pontica наричаме миграционния път на птиците'
|
||||
},
|
||||
{
|
||||
q: 'What stands for "Via Pontica"?',
|
||||
a: ['The migration route of birds passing by the Burgas lakes', 'A rare species of bird', 'Location in Burgas'],
|
||||
h: 'Wrong answer. Via Pontica is the name given to the migratory route of birds.'
|
||||
},
|
||||
{
|
||||
q: 'Къдроглавият пеликан...',
|
||||
a: ['...има огромен жълт клюн', '...има малък розов клюн', '...не се среща в България'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Group, Vector3, Matrix4, Mesh, Quaternion, PlaneGeometry, MeshStandardMaterial, DoubleSide } from 'three';
|
||||
import { Group, Vector3, Matrix4, Mesh, Quaternion, PlaneGeometry, MeshStandardMaterial, DoubleSide, CanvasTexture, SRGBColorSpace } from 'three';
|
||||
import { InteractiveObject } from '../InteractiveObject';
|
||||
import { ActiveEvents } from '@dimforge/rapier3d';
|
||||
import Utils from '@/lib/Utils';
|
||||
|
||||
class MazeObject {
|
||||
constructor(engine, def, params = {}){
|
||||
|
||||
@@ -22,13 +22,17 @@ class MazeQuizGame {
|
||||
this.mazeObject = new MazeObject(engine, def)
|
||||
engine.addEventListener('collision', async e=>{
|
||||
let ud = engine.phy.world.getCollider(e.handle2)?.parent()?.userData;
|
||||
if (ud?.finish && engine.hero?.animationsMap?.win){
|
||||
if (ud?.finish){
|
||||
if (e.started){
|
||||
engine.dashboard.updateProgress(1)
|
||||
engine.hero.animationsMap._idle = engine.hero.animationsMap.idle
|
||||
engine.hero.animationsMap.idle = engine.hero.animationsMap.win
|
||||
engine.hero.characterControls.cameraDelta = Math.PI;
|
||||
if ( engine.hero.animationsMap?.win){
|
||||
engine.hero.animationsMap.idle = engine.hero.animationsMap.win
|
||||
}
|
||||
await Utils.wait(1000);
|
||||
engine.hero.characterControls.cameraDelta = Math.PI;
|
||||
engine.hero.characterControls.direction += Math.PI;
|
||||
//engine.hero.model.rotation.y += Math.PI;
|
||||
await Utils.wait(10000);
|
||||
this.onfinish?.()
|
||||
}else{
|
||||
@@ -36,6 +40,12 @@ class MazeQuizGame {
|
||||
engine.hero.characterControls.cameraDelta = 0
|
||||
}
|
||||
}
|
||||
if (ud.qid !== undefined && e.started){
|
||||
engine.dashboard.update({
|
||||
hint: ud.question.q
|
||||
})
|
||||
engine.dashboard.updateProgress(ud.qid / questions.length)
|
||||
}
|
||||
//console.log(e, ud, engine.hero?.animationsMap);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user