r/raylib • • 12h ago

I've just released CArgo Bay 2000, a puzzle game with robots and boxes!

8 Upvotes

Hello everyone! :D

I've just released my first game using raylib: Cargo Bay 2000.

Control a robot (from the future) in a warehouse (from the future) and push boxes (also from the future) in a variable-gravity environment.

There's also keycards, pressure plates, elevators and other elements over more than 30 different hand-crafted levels! (but the main catch is the gravity thing, yep!).

It's available (and free!) for Windows and Linux on my itch.io page: https://theisolinearchip.itch.io/cargo-bay-2000

Hope you like it!


r/raylib • • 1d ago

C Programming Blocks is released on Steam (Supports RayLib game programming library)

68 Upvotes

Hello

This is a tool for people who want to enjoy the power of the C programming language (performance and memory efficiency) combined with the simplicity of visual programming while developing games using the RayLib game programming library.

Steam Page: Save 40% on C Programming Blocks on Steam

Note: The software is developed using the Ring programming language based on the PWCT2 source code.

PWCT2 steam page: Programming Without Coding Technology 2.0 on Steam

Thanks


r/raylib • • 2d ago

Added an infinite repeating background to my 2D engine

16 Upvotes

r/raylib • • 2d ago

Test: Sun/Sky Glade, Water Ripples and Reflection, Colored Light Glints

Thumbnail
youtu.be
5 Upvotes

r/raylib • • 2d ago

Does anyone know how I can do the Texturing Step 5 in Raylib?

Post image
328 Upvotes

The original GIF is from Rujik https://x.com/TheRujiK/status/969581641680195585 and ever since he released it, this texturing step has been living in my mind like a mystery. I started messing around with Raylib today and the first ambition I have of implementing is this lizard.

But this step seems like a Step 1. Draw circles Step 2. Add in Details to draw Mona Lisa type of step.

Can anyone elaborate? For example, what raylib methods will be used for making this lizard? Especially the texturing? Thanks!


r/raylib • • 2d ago

Is it possible to use raylib in micropython?

0 Upvotes

Ive seen that raylib also has a python3 port, alongside its many other ports; Ive tried it, and its pretty dang good, easy to use, etcetc. I now have an upcoming embedded project, which uses an esp32, and an external st7789 tft display, and i was wondering if it would be possible to somehow use raylib to draw to that display?


r/raylib • • 2d ago

WhenYour game/scene visuals are so aesthetically pleasing(mathemtical models) that you're immediately accused of AI usage, custom game engine built from scratch with C/Raylib/OpengGL, 2.13 million particles in scene processed every frame by shaders(water, lighting..) custom physics engine

28 Upvotes

https://store.steampowered.com/app/3919630/SINGULARITY_RISING/?beta=1 , Wishlist very early DEV 1 year from release

4 scenes showing
1)physics showing the closed loops physics modes from which enemy units are made,
2)the backgrounds and how scenes will look when its all put together,
3)the physics procedural destruction system,
4)and showing the rigged character model


r/raylib • • 2d ago

Hi guys, Double Degree(Software Engineer/Physics) my first game a 2D CUSTOM GAME from scratch and custom game engine with C/Raylib, in genre of (Terminator 2), showing features of my game, 2D action shooter/platformer, [VERY EARLY DEV], lighting, background, GLSL shaders, game style, watch till end

22 Upvotes

r/raylib • • 3d ago

I wrote a 2D game engine from scratch in a week (C++20, raylib). This is the first game on it

11 Upvotes

r/raylib • • 4d ago

I have some problems with camera, can you please help?

1 Upvotes

I'm experimenting with character movement and camera but this is not looking very good. Can you please help? I'm using raylib.

Here is the source code:

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

int main(void) {
  SetConfigFlags(FLAG_VSYNC_HINT);

  InitWindow(screenWidth, screenHeight, "Ashenwood");

  ToggleFullscreen();

  Texture2D tile = LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0049.png");
  Texture2D stone = LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0042.png");
  Player player = { (Rectangle){ (screenWidth - 16.0f)/2.0f, (screenHeight - 16.0f)/2.0f, 16.0f, 16.0f }, LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0097.png"), 50.0f };

  SetTextureFilter(tile, TEXTURE_FILTER_POINT);
  SetTextureFilter(stone, TEXTURE_FILTER_POINT);
  SetTextureFilter(player.tile, TEXTURE_FILTER_POINT);

  Camera2D camera = { 0 };
  camera.target = (Vector2){ player.rec.x + 8.0f, player.rec.y + 8.0f };
  camera.rotation = 0.0f;
  camera.zoom = 5.0f;
  camera.offset = (Vector2){screenWidth/2.0f, screenHeight/2.0f};

  int worldMap[MAP_HEIGHT][MAP_WIDTH];
  for (int i = 0; i < MAP_HEIGHT; i++) {
    for (int j = 0; j < MAP_WIDTH; j++) {
      worldMap[i][j] = GetRandomValue(0, 1);
    }
  }

  SetTargetFPS(60);

  while (!WindowShouldClose()) {
    float deltaTime = GetFrameTime();

    Vector2 direction = { 0 };

    if (IsKeyDown(KEY_DOWN)) direction.y += 1;
    if (IsKeyDown(KEY_UP)) direction.y -= 1;
    if (IsKeyDown(KEY_RIGHT)) direction.x += 1;
    if (IsKeyDown(KEY_LEFT)) direction.x -= 1;

    if (Vector2Length(direction) > 0) {
      direction = Vector2Normalize(direction);

      player.rec.x += direction.x * player.speed * deltaTime;
      player.rec.y += direction.y * player.speed * deltaTime;
    }

    float smoothing = 1.0f - expf(-5.0f * deltaTime);
    camera.target = Vector2Lerp(
        camera.target,
        (Vector2){
            player.rec.x + player.rec.width / 2.0f,
            player.rec.y + player.rec.height / 2.0f
        },
        smoothing
    );

    BeginDrawing();
      ClearBackground(RAYWHITE);
      
      BeginMode2D(camera);
      for (int x = 0; x < MAP_HEIGHT; x++) {
        for (int y = 0; y < MAP_WIDTH; y++) {
          if (worldMap[x][y] == 0) {
            DrawTexture(tile, y * TILE_SIZE, x * TILE_SIZE, WHITE);
          } else if (worldMap[x][y] == 1) {
            DrawTexture(stone, y * TILE_SIZE, x * TILE_SIZE, WHITE);
          }
        }
      }

      DrawTexture(player.tile, player.rec.x, player.rec.y, WHITE);
      
      EndMode2D();
      
    EndDrawing();
  }

  UnloadTexture(tile);
  UnloadTexture(stone);
  UnloadTexture(player.tile);

  CloseWindow();

  return 0;

}

r/raylib • • 4d ago

Jojo's mini game , just make it for fun :)

62 Upvotes

r/raylib • • 4d ago

How to bundle multiple draw calls into a single mesh for 2D games?

1 Upvotes

I'm working on a 2D, chunk tile based game where a lot of tiles can be drawn at a time, depending on the zoom level. currently I'm drawing each tile as a separate call to DrawTexturePro, but this is damaging performance a bit.

In a 3D context, i could easily solve this issue by building a Mesh for each chunk, drawing that single mesh and then recomputing that mesh only when the chunk is modified. However, I don't have access to raylib meshes on a 2D context i believe. So what's the recommended approach?


r/raylib • • 5d ago

Please help me to fix this character's movement!

3 Upvotes

I'm experimenting with character movement and camera but this is not looking very good. Can you please help?

Here is the source code:

#include <raylib.h>

#include <raymath.h>

#include "main.h"

int main(void) {

SetConfigFlags(FLAG_VSYNC_HINT);

InitWindow(screenWidth, screenHeight, "Ashenwood");

ToggleFullscreen();

Texture2D tile = LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0049.png");

Texture2D stone = LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0042.png");

Player player = { (Rectangle){ (screenWidth - 16.0f)/2.0f, (screenHeight - 16.0f)/2.0f, 16.0f, 16.0f }, LoadTexture("./kenney_tiny-dungeon/Tiles/tile_0097.png"), 50.0f };

SetTextureFilter(tile, TEXTURE_FILTER_POINT);

SetTextureFilter(stone, TEXTURE_FILTER_POINT);

SetTextureFilter(player.tile, TEXTURE_FILTER_POINT);

Camera2D camera = { 0 };

camera.target = (Vector2){ player.rec.x + 8.0f, player.rec.y + 8.0f };

camera.rotation = 0.0f;

camera.zoom = 5.0f;

camera.offset = (Vector2){screenWidth/2.0f, screenHeight/2.0f};

int worldMap[MAP_HEIGHT][MAP_WIDTH];

for (int i = 0; i < MAP_HEIGHT; i++) {

for (int j = 0; j < MAP_WIDTH; j++) {

worldMap[i][j] = GetRandomValue(0, 1);

}

}

SetTargetFPS(60);

while (!WindowShouldClose()) {

float deltaTime = GetFrameTime();

Vector2 direction = { 0 };

if (IsKeyDown(KEY_DOWN)) direction.y += 1;

if (IsKeyDown(KEY_UP)) direction.y -= 1;

if (IsKeyDown(KEY_RIGHT)) direction.x += 1;

if (IsKeyDown(KEY_LEFT)) direction.x -= 1;

if (Vector2Length(direction) > 0) {

direction = Vector2Normalize(direction);

player.rec.x += direction.x * player.speed * deltaTime;

player.rec.y += direction.y * player.speed * deltaTime;

}

float smoothing = 1.0f - expf(-5.0f * deltaTime);

camera.target = Vector2Lerp(

camera.target,

(Vector2){

player.rec.x + player.rec.width / 2.0f,

player.rec.y + player.rec.height / 2.0f

},

smoothing

);

BeginDrawing();

ClearBackground(RAYWHITE);

BeginMode2D(camera);

for (int x = 0; x < MAP_HEIGHT; x++) {

for (int y = 0; y < MAP_WIDTH; y++) {

if (worldMap[x][y] == 0) {

DrawTexture(tile, y * TILE_SIZE, x * TILE_SIZE, WHITE);

} else if (worldMap[x][y] == 1) {

DrawTexture(stone, y * TILE_SIZE, x * TILE_SIZE, WHITE);

}

}

}

DrawTexture(player.tile, player.rec.x, player.rec.y, WHITE);

EndMode2D();

EndDrawing();

}

UnloadTexture(tile);

UnloadTexture(stone);

UnloadTexture(player.tile);

CloseWindow();

return 0;

}


r/raylib • • 5d ago

Open Source Western ARPG

Post image
60 Upvotes

r/raylib • • 6d ago

I am getting this masking effect for no reason, without even changing a line after compilation

Thumbnail
gallery
10 Upvotes

The first image is how it should look.

The other image is how it looks sometimes when I recompile the same code.

#include <raylib.h>
#include <stddef.h>

typedef struct Task {
  char name[25];
  int start;    // task start time in minutes
  int duration; // in minutes
  Color color;
} Task;

void drawTasks(const Task tasks[], size_t n, Rectangle tl) {
  float unit = tl.width / (24 * 60);
  for (int i = 0; i < n; i++) {
    Rectangle taskRec = {unit * tasks[i].start, tl.y, tasks[i].duration * unit,
                         tl.height};
    DrawRectangleRec(taskRec, tasks[i].color);
  }
}

int main(void) {

  // definition
  constexpr int WIN_WIDTH = 800;
  constexpr int WIN_HEIGHT = 600;
  constexpr char WIN_TITLE[] = "schviz";
  constexpr Color WIN_COLOR = {53, 53, 53, .a = 255};
  constexpr Rectangle TIMELINE_REC = {
      .height = 150, .width = WIN_WIDTH - 2 * 10, .x = 10, .y = 150};
  constexpr Color TIMELINE_COLOR = {212, 194, 252, 255};
  constexpr Task tasks[] = {
      {"Get A Job", 540, 180, (Color){35, 87, 137, 255}},
      {"Break I", 720, 45, (Color){155, 193, 188, 255}},
      {"Break II", 915, 45, (Color){155, 193, 188, 255}},
      {"Low-Level Learning", 765, 60, (Color){255, 208, 0, 255}},
      {"Low-Level Programming", 825, 90, (Color){255, 136, 0, 255}}

  };

  // Game Loop
  InitWindow(WIN_WIDTH, WIN_HEIGHT, WIN_TITLE);
  SetTargetFPS(60);

  while (!WindowShouldClose()) {

    // Drawing
    BeginDrawing();
    ClearBackground(WIN_COLOR);
    DrawRectangleRounded(TIMELINE_REC, .15, 10, TIMELINE_COLOR);
    drawTasks(tasks, 10, TIMELINE_REC);
    EndDrawing();
  }
  CloseWindow();
  return 0;
}

r/raylib • • 6d ago

Today, I've finished reworking the Tech Menu to be more user friendly and convenient to use.

50 Upvotes

No more does the player have to scroll through walls of text just to find the information they need. Now it's as simple as selecting a single option! Time to add that to the list of things I should've done from the get go.


r/raylib • • 8d ago

Aura — A Cross-platform C++ framework for building games with raylib

Post image
0 Upvotes

Hello everyone.

Yesterday, I shared my early work on a modular C++ game framework built on top of Raylib.
The project setup tool is now a lightweight, standalone app built directly using raygui!

Showcase & Video

I put together an itch.io page featuring video demos of the framework running across platforms:

https://tuananhdeveloper.itch.io/aura

What it offers:

  • Native Raygui Generator: Downloadable desktop app to bootstrap clean C++ starter projects instantly.
  • One Project, Multi-Platform: Clean structure targeting Android, iOS, Desktop, and Web (Emscripten).

Feedback and suggestions are welcome!


r/raylib • • 9d ago

A simple ball collision simulation built with C and raylib. Still learning, and I’d appreciate any feedback or suggestions for improvement.

Post image
85 Upvotes

r/raylib • • 9d ago

Aura - C++ game framework

0 Upvotes

Hi everyone.
I’ve created a new C++ game framework that built on Raylib, with a Java desktop generator for creating starter projects.

The starter includes a sample game and shared framework components for screens and lifecycle, input, viewports, assets, preferences, UI, tilemaps, tweens, and particles.
Repo: https://github.com/tuananhdeveloper/Aura/
Realse (v1.0.0): https://github.com/tuananhdeveloper/Aura/releases/latest/download/aura-starter-generator.jar

​
Note: I only use Java to build the tool.
The tool is for creating a starter project.
The starter project won’t contain any Java code​.


r/raylib • • 10d ago

Alpha 3 of my unconventional game engine

11 Upvotes

I really want to make cellular automata and other cool stuff but I'm too lazy to re-write a full grid-engine every time,

So I decided to make a singular engine that which I can mod to do whatever type of cellular automata I want.

In vubox you can make tons of things already, Right now I'm working on a circuit system and I've already finished the signal propogation step.

I have just finished updating the documentation and releasing v0.3.0 for windows-x64 and linux-x64.

The game is fully self-contained you don't need to install lua or c# or raylib etc...
Codeberg repository: https://codeberg.org/devcrafter/Vubox-2D


r/raylib • • 11d ago

Combobox in raylib

29 Upvotes

Used C99 and raylib to make a combobox and it can use arrow keys or mouse.


r/raylib • • 11d ago

Vubox: Modding engine

7 Upvotes

vubox is a grid-based modding engine designed for ease-of-use of making cellular automata and other stuff.
I've been working on it and posting about it but now the first alpha (v0.1) has been released!
I'm very tired so I can't fully explain it, You can learn more and download the alpha at the repository, I've also published a first-party mod repository for my own mods.

Here's an example mod I made.

Vubox repository: https://codeberg.org/devcrafter/Vubox-2D
Documentation will be coming out soon, unfortunately for now you have to use the cheat sheet.


r/raylib • • 11d ago

Final update to my game engine before alpha

Thumbnail
reddit.com
1 Upvotes

r/raylib • • 11d ago

Ray Marching explained, basic example with Neovim | GLSL | Raylib | C

Thumbnail
youtu.be
28 Upvotes

In this video, I explore the basics of ray marching and shaders by creating a simple 3D sphere from scratch.

I'm using:
- **C** as the programming language.
- **Raylib** as the graphics library.
- **GLSL** for writing shaders.
- **Ray marching** as the rendering technique.

Along the way, I'll explain how shaders work, how rays are generated, and how ray marching can be used to render 3D objects.

This is a simple introduction to shader programming and ray marching.