using static System.Convert;
using static SplashKitSDK.SplashKit;
const int WINDOW_WIDTH = 600;
const int WINDOW_HEIGHT = 600;
/*-------------------------------------\
| BOTTLE_LEFT_X BOTTLE_RIGHT_X
| ^ | x | <-- x = BOTTLE_CENTER_X
| | |\___________/| + BOTTLE_TOP_Y
| | | ___________ | | waterHeight
| v | | <-- BOTTLE_BASE_Y
| <-----x-----> BOTTLE_RADIUS
\-------------------------------------*/
const int BOTTLE_RADIUS = 80;
const int BOTTLE_HEIGHT = 400;
const int BOTTLE_DIAMETER = BOTTLE_RADIUS * 2;
const int BOTTLE_CENTER_X = WINDOW_WIDTH / 2;
const int BOTTLE_LEFT_X = BOTTLE_CENTER_X - BOTTLE_RADIUS;
const int BOTTLE_RIGHT_X = BOTTLE_CENTER_X + BOTTLE_RADIUS;
const int BOTTLE_BASE_Y = WINDOW_HEIGHT - BOTTLE_RADIUS - 5; // 5 pixel gap
const int BOTTLE_TOP_Y = BOTTLE_BASE_Y - BOTTLE_HEIGHT;
WriteLine("Water Bottle Visualiser!");
WriteLine("How full us your bottle? (0-100)");
// Convert the text entered to a double
percentFull = ToInt32(line);
double waterHeight = BOTTLE_HEIGHT * (percentFull / 100.0);
double waterY = BOTTLE_BASE_Y - waterHeight;
OpenWindow("Your Water Bottle", WINDOW_WIDTH, WINDOW_HEIGHT);
ClearScreen(ColorWhite());
// Circle at the top of the water
FillCircle(ColorBlue(), BOTTLE_CENTER_X, waterY, BOTTLE_RADIUS);
// Circle at the bottom of the bottle
FillCircle(ColorBlue(), BOTTLE_CENTER_X, BOTTLE_BASE_Y, BOTTLE_RADIUS);
DrawCircle(ColorBlack(), BOTTLE_CENTER_X, BOTTLE_BASE_Y, BOTTLE_RADIUS);
// Draw the rest of the water
FillRectangle(ColorBlue(), BOTTLE_LEFT_X, waterY, BOTTLE_DIAMETER, waterHeight);
DrawCircle(ColorBlack(), BOTTLE_CENTER_X, waterY, BOTTLE_RADIUS);
// Draw the left wall of the bottle
DrawLine(ColorBlack(), BOTTLE_LEFT_X, BOTTLE_BASE_Y, BOTTLE_LEFT_X, BOTTLE_TOP_Y);
// Draw the right wall of the bottle
DrawLine(ColorBlack(), BOTTLE_RIGHT_X, BOTTLE_BASE_Y, BOTTLE_RIGHT_X, BOTTLE_TOP_Y);
DrawCircle(ColorBlack(), BOTTLE_CENTER_X, BOTTLE_TOP_Y, BOTTLE_RADIUS);