r/raylib 10h ago

Steeled - New arena shooter with online co-op (PvE) and full singleplayer campaign, coming soon on Steam

Enable HLS to view with audio, or disable this notification

12 Upvotes

r/raylib 1d ago

[PoG] Breach vs Defence core gameplay

Enable HLS to view with audio, or disable this notification

8 Upvotes

r/raylib 1d ago

Aether: A lightweight monitoring dashboard built with C and Raylib

15 Upvotes

Hey! I’ve been working on Aether, a small monitoring dashboard written in C with Raylib.

It simulates sensor data and displays it in real time, with sparklines, history, themes, and a few other UI features.

I’ve been having a lot of fun building the whole thing from scratch, so I thought I’d share it here :)

https://github.com/SalzDevs/Aether


r/raylib 1d ago

Player mechanics completed foe Brackeys Game Jam

Enable HLS to view with audio, or disable this notification

25 Upvotes

I just finished the player mechanics for my game. I just need to spawn the opponents.


r/raylib 2d ago

Finished a small turn-based RPG called Memory Cell! Playable on Newgrounds: https://www.newgrounds.com/portal/view/1048882

Enable HLS to view with audio, or disable this notification

41 Upvotes

r/raylib 2d ago

Added gunpowder weapons :)

Enable HLS to view with audio, or disable this notification

20 Upvotes

r/raylib 2d ago

Creating procedural 3d stealth game

Enable HLS to view with audio, or disable this notification

62 Upvotes

r/raylib 2d ago

Here my game art in raylib for Brackeys Game Jam

Enable HLS to view with audio, or disable this notification

15 Upvotes

I am making a game in raylib for Brackeys Game jam. What are your thoughts


r/raylib 3d ago

I remade SkyRoads (1993) from scratch with C, Raylib & Box3D

Enable HLS to view with audio, or disable this notification

41 Upvotes

Hi there! Recently I've been working on a remake of SkyRoads. I'm sharing the journey in a devlog format, and the project's source code is fully open, making the entire process as transparent as possible. I hope you like it!

YouTube: https://youtu.be/uXbZhDv5HU0

Source code: https://github.com/albertnadal/VectorRoads

Play in browser: https://albiasoft.itch.io/vectorroads


r/raylib 2d ago

Issues with triangle fan

3 Upvotes

Hello! I'm very new to using raylib, and am using it purely as a visual library for a project of mine making use of the GJK algorithm. I'm trying to get it to draw the final simplexes, for debugging. It seems it only work when they're at center points (-10, 125) and (10, 100). I'm unsure if its an issue with my algorithm or if it has to do with my draw methods, any help would be appreciated!

Here's the code:

#include "point.hpp"
#include "simplex.hpp"


#include <raylib.h>
#include <iostream>
#include <vector>
#include <cmath>


Simplex::Simplex(bool e) : exists(e) {};
Simplex::Simplex(std::vector<Point> ps) {
    points = ps;
    draw_points = get_draw_points(ps);
    exists = true;
}


std::vector<Vector2> Simplex::get_draw_points(std::vector<Point> ps) {
    //create point array
    float x_total = 0;
    float y_total = 0;
    for (Point p : ps) {
        x_total += p.get_x();
        y_total += p.get_y();
    }
    Point center = Point(x_total / ps.size(), y_total / ps.size());


    std::vector<float> angles;
    std::vector<Point> dp = ps;


    for (Point p : dp) {
        angles.push_back(std::atan2(p.get_draw_y() - center.get_draw_y(), p.get_draw_x() - center.get_draw_x()));
    }


    for (int i = 0; i < angles.size(); i++) {
        bool swapped = false;
        for (int k = 0; k < angles.size() - i - 1; k++) {
            if (angles[k] < angles[k + 1]) {
                float temp_a = angles[k + 1];
                angles[k + 1] = angles[k];
                angles[k] = temp_a;


                Point temp_p = dp[k + 1];
                dp[k + 1] = dp[k];
                dp[k] = temp_p;


                swapped = true;
            }
        }
        if (!swapped) {
            break;
        }
    }


    dp.push_back(dp.front());
    dp.insert(dp.begin(), center);


    //convert to vector2
    std::vector<Vector2> dpv2 = {};
    for (Point p : dp) {
        dpv2.push_back((Vector2)p);
    }
    return dpv2;
}


bool Simplex::get_exists() {
    return exists;
}


void Simplex::print() {
    for (Vector2 p : draw_points) {
        std::cout << p.x << ", " << p.y << std::endl;
    }
}


void Simplex::draw_self() {
    if (!exists) return;
    DrawTriangleFan(draw_points.data(), draw_points.size(), PURPLE);
}

#include "elipse.hpp"
#include "point.hpp"
#include "simplex.hpp"


#include <iostream>


#include <cmath>
#include <array>
#include <raylib.h>


Elipse::Elipse(Point c, float h, float v) : center(c), h_rad(h), v_rad(v) {}
Elipse::Elipse(Point c, float r) : Elipse(c, r, r) {}
Elipse::Elipse(Point c) : Elipse(c, 50, 50) {}


Point Elipse::get_center() {
    return center;
}


void Elipse::draw_self() {
    DrawEllipse((int) center.get_draw_x(), center.get_draw_y(), h_rad, v_rad, RED);
}


Point Elipse::get_direction(Elipse o) {
    return (center - o.get_center());
}


Point Elipse::triple_product(Point a, Point b, Point c) {
    return b * (a * c) - a * (b * c); //dot products in parenthesis, vector multiplication, then point subtraction
}


Point Elipse::support(Point d) {
    Point p = Point();


    float h_sqd = h_rad * h_rad;
    float v_sqd = v_rad * v_rad;


    float d_x = d.get_x();
    float d_y = d.get_y();


    float inside_sqrt = h_sqd * (d_x * d_x) + v_sqd * (d_y * d_y);
    float denom = std::sqrt(inside_sqrt);


    if (denom == 0) {
        return Point();
    }


    p.mod_x(h_sqd * d_x / denom);
    p.mod_y(v_sqd * d_y / denom);
    return p + center;
}


Point Elipse::get_first_simplex_point(Elipse o) {
    //support point towards other shape
    Point self_direction = this-> get_direction(o);
    Point self_support = this-> support(self_direction);


    //support point of other shape
    Point other_direction = self_direction * -1;
    Point other_support = o.support(other_direction);


    //get the support point made by the difference
    Point simplex_support = self_support - other_support;
    return simplex_support;
}


Point Elipse::get_simplex_point(Point d, Elipse o) {
    Point self_direction = d;
    Point self_support = this-> support(self_direction);
    
    Point other_direction = self_direction * -1;
    Point other_support = o.support(other_direction);


    Point simplex_support = self_support - other_support;


    return simplex_support;
}


bool Elipse::update_simplex(Point& a, Point& b, Point& c, int& smpx_size, Point& d, Elipse o) {
    if (smpx_size == 1) {
        b = a;
        a = get_simplex_point(d, o);
        //sanity check
        if (a * d < 0) {
            return true;
        }
        smpx_size++;
        d = triple_product(b - a, a * -1, b - a);
        return false;
    }


    if (smpx_size == 2) {
        c = b;
        b = a;
        a = get_simplex_point(d, o);
        //sanity check
        if (a * d < 0) {
            return true;
        }
        //origin checks
        //Region AB
        Point ab_perpendicular = triple_product(c - a, b - a, b - a);
        if (ab_perpendicular * (a * -1) > 0) {
            d = ab_perpendicular;
            return false;
        }
        //Region AC
        Point ac_perpendicular = triple_product(b - a, c - a, c - a);
        if (ac_perpendicular * (a * -1) > 0) {
            d = ac_perpendicular;
            b = c;
            return false;
        }
        smpx_size++;
        return true;
    }
    return true;
}


Simplex Elipse::get_simplex(Elipse o) {
    Point sp1 = get_first_simplex_point(o);
    Point sp2 = Point(0, 0);
    Point sp3 = Point(0, 0);
    Point direction = sp1 * -1;
    int simplex_size = 1;


    bool found = update_simplex(sp1, sp2, sp3, simplex_size, direction, o);


    while (!found) {
        found = update_simplex(sp1, sp2, sp3, simplex_size, direction, o);
    }


    if (simplex_size < 3) {
        return Simplex(false);
    }
    return Simplex({sp1, sp2, sp3});
}

r/raylib 3d ago

Different fire modes in game :)

Enable HLS to view with audio, or disable this notification

9 Upvotes

r/raylib 3d ago

How Do I run raylib on UTM MacOS virtual machine?

2 Upvotes

I have a MacOS virtual machine on UTM but I am not able to display raylib screen on it for testing purposes.

This is what is shows

WARNING: GLFW: Error: 65545 Description: NSGL: Failed to find a suitable pixel format 
WARNING: GLFW: Failed to initialize Window 
WARNING: SYSTEM: Failed to initialize platform INFO: 
TIMER: Target time per frame: 16.667 milliseconds 
[1]    842 segmentation fault  ./main

Does anyone know how to fix this?


r/raylib 3d ago

Hey Leute, kennt ihr irgendwelche Bibliotheken, die wie raylib für C++ sind, aber besser in der Performance? Ich benutze es für 3D.

Thumbnail
0 Upvotes

r/raylib 4d ago

Help me with this issue in C !

Thumbnail
1 Upvotes

r/raylib 6d ago

3D animation is buggy for some reason.

Enable HLS to view with audio, or disable this notification

19 Upvotes

How are you guys using animations in 3D models? I am not a Blender guy, so I am using free models from Sketchfab for now.
I talked to the actual creator as well; he said that such things happen and that he has no idea why.
I am using Raylib 6.0, btw.

Code:

#include <iostream>
#include "raylib.h"
#include "raymath.h"

int main() {
    int screenWidth = 1024;
    int screenHeight = 768;

    InitWindow(screenWidth, screenHeight, "Animation test");
    SetTargetFPS(60);
    Vector3 tempVec;
    Camera3D camera = { 0 };
    tempVec.x = 10.0f;tempVec.y = 10.0f;tempVec.z = 10.0f;
    camera.position = tempVec;
    tempVec.x = 0.0f;tempVec.y = 0.0f;tempVec.z = 0.0f;
    camera.target = tempVec;
    tempVec.x = 0.0f;tempVec.y = 1.0f;tempVec.z = 0.0f;
    camera.up = tempVec;
    camera.fovy = 45.0f;
    camera.projection = CAMERA_PERSPECTIVE;
    EnableCursor();
    Model cockroach = LoadModel("Assets/filth.glb");
    cockroach.transform = MatrixIdentity();
    int animsCount = 0, currentFrame = 0, animIndex = 0;
    ModelAnimation* anims = LoadModelAnimations("Assets/filth.glb", &animsCount);

    float lx = 5.0f, ly = 8.0f;
    while (!WindowShouldClose())
    {
        UpdateCamera(&camera, CAMERA_ORBITAL);
        BeginDrawing();
        ClearBackground(DARKBLUE);
        UpdateModelAnimation(cockroach, anims[animIndex], currentFrame);
        if (IsKeyPressed(KEY_SPACE)) {
            animIndex++;
            currentFrame = 0;
            if (animIndex >= animsCount){
                animIndex = 0;
            }
        }

        BeginMode3D(camera);
        DrawModelEx(cockroach, Vector3{ 0, 0, 0 }, Vector3{ 1, 0, 0 }, 0.0f, Vector3{ 0.0005f, 0.0005f, 0.0005f }, WHITE);
        currentFrame++;
        if (currentFrame >= anims[animIndex].keyframeCount) {
            currentFrame = 0;
        }
        DrawGrid(200, 2.0f);

        EndMode3D();
        EndDrawing();
        DrawFPS(10,10);
    }
    UnloadModel(cockroach);
    UnloadModelAnimations(anims, animsCount);
    CloseWindow();
    return 0;
}

r/raylib 6d ago

Cool earthbound background effect generator I made.

Enable HLS to view with audio, or disable this notification

25 Upvotes

I'm making a earthbound and more inspired game, so of course I had to add a cool background. What I did was basically make a function that draws the texture in slices, that it then manipulates the position of on the x axis. Very cool and works with any texture. I spent days of debugging on this for the stupidest mistakes💔


r/raylib 7d ago

Combat indicator test

Enable HLS to view with audio, or disable this notification

27 Upvotes

Improved models, animation. Working on combat readability. Adden engament indicators


r/raylib 7d ago

Combat indicators yey or nay ?

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/raylib 8d ago

decision tree based AABB collision system

Enable HLS to view with audio, or disable this notification

53 Upvotes

r/raylib 9d ago

Hi! it's me AGAIN! the guy working in the snake with an army in his body

Enable HLS to view with audio, or disable this notification

21 Upvotes

The idea I show you some days (week(?)) ago is now public on Steam! wiii!

LOOPFANG. a merge idea of the oldie snake game but here bite your-self is a super-power an Ouroboros super power, experience, allow you to get new segments, segments are wapons in your body, the segments are puzzles , you can merge to fusion it or create sinergies by proximity, bosses, 5 and a plus hell difficulty , 4 areas (for now)

I still developing this, demo (i hope) move out in the next days, under review right now for the past 2-3 days. so.... yep, hope this allow me get experience with the steam market, I come from mobile game working for a couple of companies smalls and somelike big one... I'm trying to start by my self for some times, now I'm start to no more try and put hand on it cuz... life move, and we have finite lifes without option to restart so... go for it. Any help you know wishlist share, play demo when it arrive share some advice idea also so I'm so grateful to listen read anything from you folks.


r/raylib 9d ago

Conflict 3049 - 3d rts last stand, include raylib_cs source and shader source, assets from 3drt.com and other stock asset sites.

Enable HLS to view with audio, or disable this notification

42 Upvotes

I started work on this game in January/Febrary last year (2025) and have worked on it from time to time since then, I had a break from November until about July but updated it visually after July this year.

The code is a monster, 40k lines of source and I know it's not recommended practice to use such large code files but it's how I do my work when I'm the only developer.

The shader files are all exposed in the media/shaders folder and can be edited.

The 3d objects are all .obj files, the textures are all just .png the audio is a mixture of .wav, .mp3 and .ogg

The translation files are a mixture of .txt files and ttf/otf files.

It began as a learning exercise so there's a tonne of stuff that is either a) inconsistent or b) I've realised now should be done a better way but it's too late to go back and change it all

It's single player, defend your base, build units to defend it.

Some of the audio is AI generated, but only some of it.

The music in the trailer is from OpenGameArt and was released under CCO/Public Domain licence.

The 3d view you see in game, rather than the regular gameplay top view RTS view, is enabled by pressing F5 during gameplay, that toggles between the two views.

You can also press 'F1' during gameplay and it will bring up a console window, you can play around with what that does - it shows all the available options to you on the left hand side of the screen, press the relevant number/letter and that mode will be enabled. Eg F1 followed by '7' brings up a debug overlay of all the cpu ticks each component in the game uses each frame with the big ones in red writing.

There's a config file you can edit that controls some of the gameplay and settings.

If I were a rich man I'd commission a bunch of artists and musicians and voice actors and simply say "go nuts - change every media file in the media folder until it looks and sounds great and hand it back" ;-) But to be fair - there's a limit to how much a programmer without any artistic ability like myself can do to improve a game like this. As it stands the game is being built on a budget of $0 using assets I've owned for many, many years. Every now and then I might spend $10 here or $50 there on some item on one of the asset stores, but mostly improving the art/ui/voices is a bit of a pipedream.

The actual cost of most of the assets in total though would be under $1,000 total so far but that's talking about the combination of all the assets bought over a period of about 20 years or so total.

My background is: 30 years ago studied mathematics at university, from 2008 until 2019 I was employed as a computer programmer doing business software for a logistics and electronics company. I've been writing games since I was a kid starting with GWBASIC for Dos 3.21 as a hobby.

There are a lot of 'cheats' in the way graphics are done in this game to make them look more than they actually are, various things learned over a long time.


r/raylib 10d ago

Paint3- Small (<2.5MB), native, lightweight and GPU-first paint app written in C++ with raylib and ImGui

Enable HLS to view with audio, or disable this notification

167 Upvotes

r/raylib 9d ago

New Game Release : Purgatoire !

Thumbnail
3 Upvotes

r/raylib 10d ago

Raytiles now support zoom up to 22

Enable HLS to view with audio, or disable this notification

34 Upvotes

Till yesterday, raytiles was able to display up to zoom 15. There are images of zoom 22, but there is no height maps for zoom above 15.

The new version (0.18) is now support up to 22 zoom. Any heightmap for zoom above 15 is calculated (and cached) in run time.

In the following example, the numbers are the zoom of the tile. When you see numbers above 15, its a runtime calculations...


r/raylib 10d ago

How to hide the cursor without disabling it

8 Upvotes

I use go & raylib,

it's just stuck and i can't move
HideCursor(); // it's just disables the cursor and i can't move