h.collision = function() {
	// wall collision
	switch (canvas.inside(this.x, this.y, this.r)) {
		case "right": case "left":
			this.dx = -this.dx; break;
			
		case "top": case "bottom":
			this.dy = -this.dy; break;
	}
	
	// trail collision
	if (t.inside(this.x, this.y)) {
		this.r -= 0.2;
	}
	
	// enemy collision
	en = n.inside(h.x, h.y, h.r);
	
	if (en !== false) {
		n.remove(en);
		this.r -= n.t[en] == 0 ? 1 : 0;
	}
	
	if (this.r < 2) gameOver = true;
};

h.move = function(x, y) {
	this.a += this.v;
	
	this.x = isset(x) ? x : this.sx + Math.sin(this.a) * this.ro;
	this.y = isset(y) ? y : this.sy + Math.cos(this.a) * this.ro;
};

h.draw = function() {
	if (mobile) {
		circle(this.x, this.y, this.r, this.c);
	}
	else {
		//add cool gradiant effect
		ctx.globalAlpha = 0.2;
		
		var r = 0;
		do {
			r += 1;
			circle(this.x, this.y, r, this.c);
		} while (r < this.r);
		
		ctx.globalAlpha = 1;
	}
};

h.update = function() {
	h.collision();
	h.move();
	h.draw();
};
