public Entity(Sprite sprite, double x, double y)
	{
		this.sprite=sprite;
		this.x=x;
		this.y=y;
		this.lastX=x;
		this.lastY=y;
		if(sprite!=null)
		{
			Rectangle.Double rect=new Rectangle.Double(-sprite.anchor().x,-sprite.anchor().y,this.sprite.width(),this.sprite.height());
			this.mask=new Mask(new Area(rect));
		}
		else
		{
			this.mask=new Mask(new Area());
		}
		this.depth=0;
		this.lastDepth=this.depth;
		this.listeners=new ArrayList<EntityListener>();
		this.imageIndex=0;
		this.offset=new Point(0,0);
		//This is so each entity gets a unique id!
		allEntities.add(this);
	}