|
There is only one but... I'm drawing the picture of the object on my canvas. I should have told this:
object.prototype.draw = function(xpos, ypos) {
ctx.drawImage(this.picture,sx, sy, swidth, sheight,xpos,ypos, width, height);
}
NB: the vars sx, sy, swidth, sheight, width and height are optional; I would like to use them , so i can define my picture from a tilesheet.
|