- Game board
- cards - landing page
This commit is contained in:
17
public/js/Sprite.js
Normal file
17
public/js/Sprite.js
Normal file
@@ -0,0 +1,17 @@
|
||||
function Sprite(x, y) {
|
||||
this.sprite = PIXI.Sprite.from('/img/sprite.jpg');
|
||||
this.coord_x = x;
|
||||
this.coord_y = y;
|
||||
|
||||
this.getSprite = function () {
|
||||
this.setSize(this.sprite, sprite_size);
|
||||
return this.sprite;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user