Exemplo n.º 1
0
Stats.prototype.gems = function() {
  Engine.ctx.drawImage(Resources.get(`${Resources.path}/stat-gem.png`), 340, 62);
  Engine.ctx.font = this.font;
  Engine.ctx.fontStyle = this.fontColor;
  Engine.ctx.textAlign = 'start';
  Engine.ctx.fillText('x '+ this.currentGems, 370, 82);
};
Exemplo n.º 2
0
Stats.prototype.lives = function() {
  Engine.ctx.drawImage(Resources.get(`${Resources.path}/stat-heart.png`), 430, 62);
  Engine.ctx.font = this.font;
  Engine.ctx.fontStyle = this.fontColor;
  Engine.ctx.textAlign = 'start';
  Engine.ctx.fillText('x '+ this.currentLives, 465, 82);
};
Exemplo n.º 3
0
Collectable.prototype.render = function() {
  Engine.ctx.drawImage(Resources.get(this.sprite), this.x, this.y);
};