Should work with 64x64 collectable

This commit is contained in:
Thomas Forgione 2018-08-26 21:58:54 +02:00
parent 03c9a31d17
commit 9d3898ecf0
No known key found for this signature in database
GPG Key ID: 3B8FC64F5BBFE109
1 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ class Scene extends Screen {
this.context.drawImage( this.context.drawImage(
Collectable.texture, Collectable.texture,
0, 32 * object.frameNumber, 32, 32, 0, 64 * object.frameNumber, 64, 64,
(object.x - object.size / 2) * this.width(), (object.x - object.size / 2) * this.width(),
(1 - object.y) * this.height() - size / 2, (1 - object.y) * this.height() - size / 2,
size, size size, size
@ -306,7 +306,7 @@ class Scene extends Screen {
// Draw coin number // Draw coin number
this.context.drawImage(Collectable.texture, this.context.drawImage(Collectable.texture,
0, 0, 32, 32, 0, 0, 64, 64,
0, fontSize + 5, 0.05 * this.width(), 0.05 * this.width()); 0, fontSize + 5, 0.05 * this.width(), 0.05 * this.width());
this.context.fillText(this.collectableNumber, 0.05 * this.width() + 5, 2 * fontSize) this.context.fillText(this.collectableNumber, 0.05 * this.width() + 5, 2 * fontSize)