quiz game scoring system
This commit is contained in:
@@ -104,6 +104,13 @@ class DashBoard {
|
||||
text.position.y = -0.33;
|
||||
dash.add(text);
|
||||
|
||||
const pointsText = new Text()
|
||||
Object.assign(pointsText, {
|
||||
text:``, fontSize: 0.044, font: '/static/fonts/Montserrat-Regular.ttf'
|
||||
})
|
||||
pointsText.position.set(0.88 * engine.aspect/2, 0.33, 0);
|
||||
dash.add(pointsText);
|
||||
|
||||
engine.addEventListener('beforeRender', ()=>{
|
||||
dash.quaternion.copy(engine.camera.quaternion)
|
||||
dash.position.copy(engine.camera.position)
|
||||
@@ -145,7 +152,8 @@ class DashBoard {
|
||||
|
||||
this.addPoints = function(p){
|
||||
points += p;
|
||||
console.log('adding points', p, points)
|
||||
pointsText.text = points;
|
||||
pointsText.sync();
|
||||
}
|
||||
|
||||
this.enable = ()=>{
|
||||
|
||||
Reference in New Issue
Block a user