2021-07-01 12:46:18 +00:00
|
|
|
function Sprite(x, y, slow) {
|
2021-07-12 11:28:23 +00:00
|
|
|
if (slow) {
|
2021-07-01 12:46:18 +00:00
|
|
|
this.sprite = PIXI.Sprite.from('/img/spriteSlow.jpg');
|
2021-07-12 11:28:23 +00:00
|
|
|
} else {
|
2021-07-01 12:46:18 +00:00
|
|
|
this.sprite = PIXI.Sprite.from('/img/sprite.jpg');
|
|
|
|
}
|
2021-06-08 13:38:43 +00:00
|
|
|
this.coord_x = x;
|
|
|
|
this.coord_y = y;
|
|
|
|
|
|
|
|
this.getSprite = function () {
|
|
|
|
this.setSize(this.sprite, sprite_size);
|
|
|
|
return this.sprite;
|
2021-06-11 05:55:46 +00:00
|
|
|
};
|
2021-06-08 13:38:43 +00:00
|
|
|
|
|
|
|
this.setSize = function (sprite, size) {
|
|
|
|
sprite.x = this.coord_x * size - size * 0.2;
|
|
|
|
sprite.y = this.coord_y * size - size * 0.2;
|
|
|
|
sprite.width = size * 1.5;
|
|
|
|
sprite.height = size * 1.5;
|
2021-06-11 05:55:46 +00:00
|
|
|
};
|
2021-07-01 12:46:18 +00:00
|
|
|
}
|