package {
	import flash.display.MovieClip;
	
	public class Bullet extends MovieClip {
		var speed:int = 5;
		var Target;
		var angle:Number;
		var remove:Boolean;
		
		public function Bullet(rotate:Number, tmpMonster) {
			angle = rotate;
			Target = tmpMonster;
			this.rotation = angle/Math.PI*180;
		}
		
		public function update() {
			this.x += this.speed*Math.cos(angle);
			this.y += this.speed*Math.sin(angle);
			
			if (this.hitTestObject(Target)) {
				Target.hp -= 10;
				remove = true;
			}
			
		}
		
		
	}
	
	
	
	
}