#define Pi 3.1415926
typedef unsigned char byte_t;

void vid_mode(byte_t mode);
void swap(int &a, int &b);
void blit0(byte_t* what);
void pixel(int x, int y, byte_t color, byte_t* where);
void hline(int x1,int x2,int y,byte_t color,byte_t* where);
void vline(int x,int y1,int y2,byte_t color,byte_t* where);
void line(Vector a, Vector b,byte_t color,byte_t* where);

class Line{
	friend double mag(const Line &l);
	friend double slope(const Line &l);
	private:
		Vector p1;
		Vector p2;
	public:
		Line(const Vector &a=CENTER, const Vector &b=CENTER);
		Line(const Line &copy);
		~Line();
		void set(const Vector &a, const Vector &b);
		void draw(byte_t color, byte_t *where);
};

class Circle{
	friend void draw(const Circle &c, byte_t color, byte_t *where);
	private:
		Vector center;
		Vector velocity;
		Vector toShip;
		double radius;
		int clock;
	public:
		Circle(const Vector &c=CENTER, const Vector &v=V0, double r=10);
		Circle(const Circle &copy);
		~Circle();
		void set(const Vector &c, const Vector &v, double r);
		void size(unsigned r);
		double getsize();
		Vector getcenter();
		void speed(const Vector &v);
		bool on(const Vector &p);
		void fly(int ticks, const Vector &ship=Vector(0,0));
		int enemyType;
};

