scoring system
This commit is contained in:
+18
-4
@@ -106,9 +106,10 @@ class DashBoard {
|
||||
|
||||
const pointsText = new Text()
|
||||
Object.assign(pointsText, {
|
||||
text:``, fontSize: 0.044, font: '/static/fonts/Montserrat-Regular.ttf'
|
||||
text:``, fontSize: 0.044, font: '/static/fonts/Montserrat-Bold.ttf',
|
||||
outlineColor: 0x113377, outlineWidth: '3%', anchorX: 'center',
|
||||
})
|
||||
pointsText.position.set(0.88 * engine.aspect/2, 0.33, 0);
|
||||
pointsText.position.set(0.86 * engine.aspect/2, 0.47, 0);
|
||||
dash.add(pointsText);
|
||||
|
||||
engine.addEventListener('beforeRender', ()=>{
|
||||
@@ -152,8 +153,21 @@ class DashBoard {
|
||||
|
||||
this.addPoints = function(p){
|
||||
points += p;
|
||||
pointsText.text = points;
|
||||
pointsText.sync();
|
||||
engine.motionQueue.add({
|
||||
o: pointsText,
|
||||
a: {rotation:{y: Math.PI}, scale:{x:1.5, y:1.5, z:1.5}},
|
||||
t: 0.25,
|
||||
f:()=>{
|
||||
pointsText.text = points;
|
||||
pointsText.sync();
|
||||
engine.motionQueue.add({
|
||||
o: pointsText,
|
||||
a: {rotation:{y: Math.PI*2}, scale:{x:1, y:1, z:1}},
|
||||
t: 0.5,
|
||||
f: ()=>{pointsText.rotation.y = 0;}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.enable = ()=>{
|
||||
|
||||
Reference in New Issue
Block a user