我有一个游戏,我正在尝试实现每次跳转到平台后加分的分数。现在它只在第一个平台后添加一个,我无法弄清楚如何进行计数。任何帮助赞赏。我正在使用画架。
现在的功能代码:
update : function(){
/* UPDATE LOGIC */
this.velocity.x += this.acceleration;
this.x += this.velocity.x;
if(this.x < this.outside){
this.isOutsideLeft = true;
for (var counter =1; counter === 1; counter++){
document.getElementById('count').innerHTML = counter;
console.log('count');
}
}
},