First we
add a couple of properties to the sprite: booleans that indicate whether it is flipped horizontally or vertically. Unless told otherwise, they're both false.
function MySprite (img_url) {
this.x = 0;
this.y = 0;
this.visible= true;
this.velocity_x = 0;
this.velocity_y = 0;
this.MyImg = new Image();
this.MyImg.src = img_url ;
this.angle= 0; // How many degrees we are rotated
this.flipV = false; // Are we flipped vertically
this.flipH = false; // Are we flipped horizontally
}