Merge branch 'gh-pages' of https://github.com/teamsnowman/wastedtime into gh-pages
This commit is contained in:
commit
cccdb45f55
2 changed files with 5 additions and 3 deletions
|
@ -5,9 +5,10 @@ function Text(x,y,text,font,color,incrementFunction){
|
|||
this.color = color;
|
||||
this.opacity =1;
|
||||
this.text = text;
|
||||
this.alive=1;
|
||||
|
||||
this.draw = function(){
|
||||
if(this.opacity>0){
|
||||
if(this.alive>0){
|
||||
ctx.font= this.font;
|
||||
ctx.fillStyle = this.color;
|
||||
ctx.globalAlpha = this.opacity;
|
||||
|
@ -28,9 +29,10 @@ function Text(x,y,text,font,color,incrementFunction){
|
|||
|
||||
function fadeUpAndOut(text){
|
||||
text.opacity -=0.07;
|
||||
text.alive = text.opacity;
|
||||
text.y-=3;
|
||||
}
|
||||
|
||||
function fadeOut(text){
|
||||
text.opacity -= 0.02;
|
||||
text.alive -= 0.02;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ function consolidateBlocks(clock,side,index){
|
|||
clock.comboMultiplier += 1;
|
||||
clock.lastCombo = now;
|
||||
var coords = findCenterOfBlocks(deletedBlocks);
|
||||
clock.texts.push(new Text(coords['x'],coords['y'],"x "+clock.comboMultiplier.toString(),"bold Lovelo 24px",deletedBlocks[0].color,fadeOut));
|
||||
clock.texts.push(new Text(coords['x'],coords['y'],"x "+clock.comboMultiplier.toString(),"bold Lovelo 24px","#fff",fadeOut));
|
||||
}
|
||||
else{
|
||||
clock.lastCombo = now;
|
||||
|
|
Loading…
Reference in a new issue