A minimal C++ project scaffold for Visual Studio Code on Windows — includes a bouncing ball demo and zero boilerplate friction.
1. Double-click main.code-workspace to open the project in VS Code.
2. In the Explorer panel, open main.cpp.
3. Press F5 to compile and run.
| Feature | Details | |
|---|---|---|
| 🎱 | Bouncing ball demo | Ready-to-run example using raylib's core 2D drawing API |
| ⚙️ | VS Code tasks | Pre-configured build tasks — no manual setup required |
| ✅ | Tested on Win 10/11 | Works with raylib 4, 5, and 6 out of the box |
#include <iostream>
#include <raylib.h>
using namespace std;
int main()
{
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
int ball_x = 100;
int ball_y = 100;
int ball_speed_x = 5;
int ball_speed_y = 5;
int ball_radius = 15;
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "My first RAYLIB program!");
SetTargetFPS(60);
while (WindowShouldClose() == false)
{
ball_x += ball_speed_x;
ball_y += ball_speed_y;
if (ball_x + ball_radius >= SCREEN_WIDTH || ball_x - ball_radius <= 0)
ball_speed_x *= -1;
if (ball_y + ball_radius >= SCREEN_HEIGHT || ball_y - ball_radius <= 0)
ball_speed_y *= -1;
BeginDrawing();
ClearBackground(BLACK);
DrawCircle(ball_x, ball_y, ball_radius, WHITE);
EndDrawing();
}
CloseWindow();
}🎥 Video Tutorial on YouTube | 📺 My YouTube Channel | 🌍 My Website