Skip to content

educ8s/Raylib-CPP-Starter-Template-for-VSCODE

Repository files navigation

Raylib C++ Starter Template for VS Code

Language Raylib Platform Editor

A minimal C++ project scaffold for Visual Studio Code on Windows — includes a bouncing ball demo and zero boilerplate friction.

Preview of the bouncing ball demo — click to watch tutorial

Watch the Video Tutorial on YouTube


Get started in 3 steps

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.


What's inside

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

Quick look

#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();
}

Resources

🎥 Video Tutorial on YouTube   |   📺 My YouTube Channel   |   🌍 My Website

Releases

No releases published

Packages

 
 
 

Contributors

Languages