
function Cloud() 
{ 
	this.asset = new Image();
	var r =   Math.floor ( 2 * Math.random() );
	
	if(r)
		this.asset.src = "img/cloud.png";
	else
		this.asset.src = "img/cloud2.png";
	
	this.x = 0;
	this.y = 0;
	
	var width = 0;
	var height = 0;
	
	var _vx = Math.random()*2 +1;
	var _vy = Math.random()*2 +1;
	
	this.asset.onload = function() {
		var scale = Math.random() + 0.5;
		width  = this.width * scale;
		height = this.height * scale;
	};
	
	this.width = function()
	{
		return width;
	}
	
	this.height = function()
	{
		return height;
	}
	
	this.move = function(x, y)
	{
		this.x += (x * _vx);
		this.y += (y * _vy);
	}
} 
