#pragma once

struct Circle
{
	double x, y;
	double r;
};


class Ball
{
public:
	static const int Ball_WIDTH = 20;
	static const int Ball_HEIGHT = 20;
	static const int Ball_VEL = 1;
	const double deltaTime = 0.02;
	const double FR = 0.9;
	
	void InitializeBall(double x, double y);
	Ball() {};
	Ball(double x, double y);

	void handleEvent(SDL_Event& e);
	void render();

	Circle& getCollider();
	void shiftColliders();
	void checkCollision(Ball& otherBall);
	void UpdateSpeed();
	void move();

private:

	double mPosX, mPosY;
	double realVelX, realVelY;
	double mVelX, mVelY;

	Circle mCollider;

	double distanceSquared(double x1, double y1, double x2, double y2)
	{
		double deltaX = x2 - x1;
		double deltaY = y2 - y1;
		return deltaX*deltaX + deltaY*deltaY;
	}


};