package  
{
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Spritemap;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	import net.flashpunk.FP;
	
	public class Rock extends Projectile
	{
		[Embed(source = 'gfx/rock.png')]
		private const ROCK:Class;
		
		//public var damage:Number = 0;
		public var range:Number = 0;
		public var blast_radius:Number = 0;
		public var wallbreak:uint = 0;
		public var vx:Number;
		public var vy:Number;
		
		public function Rock()
		{
			vy = -5 - Math.random()*5;
			vx = 5 + Math.random()*10;
			if (Bazaar.player.pedd.flipped) vx *= -1;
			graphic = new Image(ROCK);
			setHitbox(8, 8, 0, 0);
			type = "bullet";
			damage = 15;
			
		}
		
		override public function update():void
		{
			(graphic as Image).angle+=vx+vy;
			vy += Bazaar.player.vfall;
			y += vy;
			x += vx;
			if (collide("level", x, y) ||
				x < 0 || y < 0 || 
				x > Bazaar.level.tilemap.sw || y > Bazaar.level.tilemap.sh) FP.world.remove(this);
			kill();
		}
		
	}
}