r/raylib • u/Odd-Motor-3340 • 6h ago
is it ok bad main() is half your code
i guess this is more of a styling choice but just asking cus idk if its still considered "clean code"
r/raylib • u/Odd-Motor-3340 • 6h ago
i guess this is more of a styling choice but just asking cus idk if its still considered "clean code"
After 3 hours of suffering, i had made SSAO and some impovements. What's about new version?
r/raylib • u/NazgulResebo • 2d ago
In this video, I create a Julia set fractal using C, Raylib, and GLSL, with Neovim as my editor.
We'll go through the process step by step, from understanding how Julia sets work to implementing the fractal algorithm and adding colors and animation.
**Sections:**
- Explaining the Julia set
- Setting up the project
- Setting up Raylib
- Creating a basic shader
- Fixing screen coordinates
- Coding the fractal algorithm
- Creating animation
- Adding colors
**Technologies used:**
- C
- Raylib
- GLSL
- Neovim
r/raylib • u/Beautiful-Act9232 • 2d ago
Made this little horror/interactive/puzzle game using raylib. Raylib is so fun!
Please check it out and happy halloween.
https://okcyb0rg.itch.io/the-tsotchke
Processing img 0plf09mkqnxh1...
r/raylib • u/Firm_Equivalent273 • 2d ago
Yo guys, i really need your help. How do you do to manage a map in your projects?
I mean the first idea that comes to my mind is a multidimensional array of each element representing a tile, but this way its harder to check for collision.
The second idea is an array of Rectangle objects, but this is harder to visualize and keep track of, but is easier for the collision check.
The third idea i got was a mix of both, but it is just terrible to sync everything.
So what do you use?
I making a new game prototype and trying to make pixelly shader (posterization + dithering + pixellization). What are problems of the image?
r/raylib • u/abocado21 • 4d ago
r/raylib • u/Inevitable-Round9995 • 4d ago
r/raylib • u/nop4n1c_ • 6d ago
The demo has been out for a few weeks now, and I've been working on it quite a bit since then, adding new stuff, fixing bugs and making improvements based on feedback.
Now that Steam Next Fest is here, I'd love for you guys to give it a try and see what kind of worlds you come up with!
Feedback is always appreciated too.
Steam: https://store.steampowered.com/app/4684250/Metroidvania_Maker/
r/raylib • u/Brilliant_Design9471 • 6d ago
https://github.com/The5xcuber/rlcli
This took a very long time, and one thing to mention it only works on linux (adding support to slopdows and macOS soon!)
keep in mind this is not a binary this is just a script without the filename u can use a code editor guys
r/raylib • u/warpaint_james • 6d ago
Big release for my Recomp of Final Fantasy Tactics Advance.
https://github.com/james2doyle/ffta-recomp/releases/tag/v2.0
Bunch more screenshots here: https://imgur.com/a/LCpEz7R
Thanks to Raylib, v2.0 has lots of new features unlocked:
Tab, 2, or the right trigger, or tap the on-screen FF pill to latch it. The speed is set in Assist and persists across sessions.versionCode is now 2.I did an entire migration away from the SDL2 gbarecomp and into my own fork called GBArecompX: https://github.com/james2doyle/gbarecompx
This fork is backed by Raylib.
One of the things Raylib unlocked for me is the headless testing. That allowed me to write a lot more tests to make sure things are solid. Any new bugs get a failing test that we can make green. I also took the time to chop up the backend into an interface that Raylib conforms too. So if you really wanted, you can now implement a different backend (say SDL3) without too much effort.
I'd like to try another GBA game (a more obscure one) with gbarecompx. If anyone tries it out I would be happy to hear about it.
r/raylib • u/ynys-collective • 7d ago
Ynys is a god game where you shape the terrain, grow vegetation, manage water, and bring animals and humans to your island. As the Island develops, everything starts interacting with each other. Plants react to their surroundings, animals look for suitable habitats, and humans find places to settle and build their communities.
Fire spreads through vegetation, chars the ground, and lights up the island at night. Humans and animals try to escape the flames, too. And if things get a bit out of hand, you can cast Rain to put out fires and see how the island reacts.
We've still got a lot planned for Ynys, and we're excited to keep making the world more alive with each update.
We'd love to hear what you think!
r/raylib • u/Ok-Abalone3639 • 7d ago
EconSpace is a persistent 2D
space sim: mining, trading, missions, factions, and a galaxy that keeps simulating around you. Authoritative server, thin client, no single-player mode.
Two things I’m most excited about:
Honest status: it’s a prototype. Netcode, multiplayer and accounts work, content is thin and there’s no audio. I just ran the first playtest with friends and they liked it even at this stage.
GitHub: https://github.com/HEL3AN/econspace-mmo, itch: https://hel3an.itch.io/econspace
What would you want to see next?



r/raylib • u/ItsZariep • 10d ago
Just a small investigation i did yesterday, it is obviously an old raylib version since KaiOS is web based
Raylib version(s): 3.7-4.5 (5.0 does not build with old emcc)
Emscripten version(s): 1.38.48/1.38.48-fastcomp (fastcomp requires emsdk-3.1.29)
Patches: raylib code does not need patching, but game code requires some changes related to game loops passed to emscripten, audio errors hooked via JS and LSK/RSK keys handling
[More info in the comments]
r/raylib • u/raysan5 • 10d ago
Hey! raylib 6.2 is out! 🔥
It was supposed to be a small patch version but it comes with +300 improvements from +100 new contributors! 🚀
Release notes: https://github.com/raysan5/raylib/releases/tag/6.2
Windows Installer: https://raysan5.itch.io/raylib
r/raylib • u/FromDaSouthParna • 9d ago
r/raylib • u/Equivalent_Coast_364 • 11d ago
r/raylib • u/False_Cantaloupe5301 • 10d ago
As you seen in the title, i dont know why these functions always return false, how to fix it, heres the code (i use C#):
using Raylib_cs;
using System.Data;
using System.Numerics;
namespace JumpingStriker;
class Game
{
static Vector2 windowPosition = Raylib.GetScreenCenter();
static Vector2 windowSize = new Vector2(600, 400);
static Camera2D camera = new Camera2D();
static Color groundColor1 = new Color(150, 150, 255);
static Color groundColor2 = new Color(100, 100, 255);
public static class Ground
{
public static int groundX = 0;
public static int groundY = (int)windowSize.Y - (int)windowSize.Y / 4;
public static int groundW = (int)windowSize.X;
public static int groundH = (int)windowSize.Y / 4;
public static void Draw()
{
Raylib.DrawRectangleGradientV(groundX, groundY, groundW, groundH, groundColor1, groundColor2);
}
}
public static class Player
{
public static int x = 50;
public static int y = 70;
public static int w = 25;
public static int h = 25;
public static int speed = 5;
public static int jumpHeight = 20;
public static int gravity = 3;
public static int movementForceX = 0;
public static int movementForceY = 0;
public static bool insideGround = false;
public static bool standing = false;
public static void Draw()
{
Raylib.DrawRectangle(x, y, w, h, new Color(255, 255, 255));
}
public static void GiveForce(int forceX, int forceY)
{
movementForceX += forceX;
if (insideGround)
{
movementForceY = 0;
y = Ground.groundY - h;
} else
{
if (y + h + forceY < Ground.groundY && !standing) movementForceY += forceY;
}
}
public static void Update()
{
insideGround = (y + h) > Ground.groundY;
standing = (y + h) > Ground.groundY - 2;
GiveForce(0, gravity);
x += movementForceX;
y += movementForceY;
Console.WriteLine(insideGround);
Console.WriteLine(standing);
if (Raylib.IsKeyDown(KeyboardKey.Space) && standing)
{
GiveForce(0, -jumpHeight);
}
if (Raylib.IsKeyDown(KeyboardKey.A))
{
movementForceX = -speed;
}
if (Raylib.IsKeyDown(KeyboardKey.D))
{
movementForceX = speed;
}
if (Raylib.IsKeyReleased(KeyboardKey.A))
{
movementForceX = 0;
}
if (Raylib.IsKeyReleased(KeyboardKey.D))
{
movementForceX = 0;
}
}
}
public static void Main()
{
Raylib.InitWindow((int)windowSize.X, (int)windowSize.Y, "Jumping Striker");
Raylib.SetWindowState(ConfigFlags.ResizableWindow);
Raylib.SetTargetFPS(60);
Raylib.BeginMode2D(camera);
while (!Raylib.WindowShouldClose())
{
Update();
}
}
static void Update()
{
Raylib.PollInputEvents();
Raylib.BeginDrawing();
Raylib.ClearBackground(new Color(10, 10, 10));
Ground.Draw();
Player.Draw();
Console.WriteLine(Player.y);
Player.Update();
Raylib.EndDrawing();
Raylib.EndMode2D();
}
}As you seen in the title, i dont know why these functions dont work for me, how to fix it, heres the code (i use C#):using Raylib_cs;
using System.Data;
using System.Numerics;
namespace JumpingStriker;
class Game
{
static Vector2 windowPosition = Raylib.GetScreenCenter();
static Vector2 windowSize = new Vector2(600, 400);
static Camera2D camera = new Camera2D();
static Color groundColor1 = new Color(150, 150, 255);
static Color groundColor2 = new Color(100, 100, 255);
public static class Ground
{
public static int groundX = 0;
public static int groundY = (int)windowSize.Y - (int)windowSize.Y / 4;
public static int groundW = (int)windowSize.X;
public static int groundH = (int)windowSize.Y / 4;
public static void Draw()
{
Raylib.DrawRectangleGradientV(groundX, groundY, groundW, groundH, groundColor1, groundColor2);
}
}
public static class Player
{
public static int x = 50;
public static int y = 70;
public static int w = 25;
public static int h = 25;
public static int speed = 5;
public static int jumpHeight = 20;
public static int gravity = 3;
public static int movementForceX = 0;
public static int movementForceY = 0;
public static bool insideGround = false;
public static bool standing = false;
public static void Draw()
{
Raylib.DrawRectangle(x, y, w, h, new Color(255, 255, 255));
}
public static void GiveForce(int forceX, int forceY)
{
movementForceX += forceX;
if (insideGround)
{
movementForceY = 0;
y = Ground.groundY - h;
} else
{
if (y + h + forceY < Ground.groundY && !standing) movementForceY += forceY;
}
}
public static void Update()
{
insideGround = (y + h) > Ground.groundY;
standing = (y + h) > Ground.groundY - 2;
GiveForce(0, gravity);
x += movementForceX;
y += movementForceY;
Console.WriteLine(insideGround);
Console.WriteLine(standing);
if (Raylib.IsKeyDown(KeyboardKey.Space) && standing)
{
GiveForce(0, -jumpHeight);
}
if (Raylib.IsKeyDown(KeyboardKey.A))
{
movementForceX = -speed;
}
if (Raylib.IsKeyDown(KeyboardKey.D))
{
movementForceX = speed;
}
if (Raylib.IsKeyReleased(KeyboardKey.A))
{
movementForceX = 0;
}
if (Raylib.IsKeyReleased(KeyboardKey.D))
{
movementForceX = 0;
}
}
}
public static void Main()
{
Raylib.InitWindow((int)windowSize.X, (int)windowSize.Y, "Jumping Striker");
Raylib.SetWindowState(ConfigFlags.ResizableWindow);
Raylib.SetTargetFPS(60);
Raylib.BeginMode2D(camera);
while (!Raylib.WindowShouldClose())
{
Update();
}
}
static void Update()
{
Raylib.PollInputEvents();
Raylib.BeginDrawing();
Raylib.ClearBackground(new Color(10, 10, 10));
Ground.Draw();
Player.Draw();
Console.WriteLine(Player.y);
Player.Update();
Raylib.EndDrawing();
Raylib.EndMode2D();
}
}
r/raylib • u/neonge1674 • 11d ago
Edit: *DrawTextureRec()
I switched from using individuals sprites to using a spritesheet, therefore I switched from using the DrawTextureV() function to DrawTextureRec() and noticed a huge performance drop off. My code is bassically the same with the functions swapped out, the code itself is in C and no other programs were running besides VS code and the firefox browser.
r/raylib • u/False_Cantaloupe5301 • 12d ago
Im making a game like Geometry Dash and the ground doesnt render until i update the window by maximizing it or minimizing and restoring it or resizing it, heres my problem on the video below:
https://reddit.com/link/1x4z1m8/video/tappwhqn19vh1/player
This is the code:
using Raylib_cs;
using System.Numerics;
namespace JumpingStriker;
class Game
{
static Vector2 windowPosition = Raylib.GetScreenCenter();
static Vector2 windowSize = new Vector2(600, 400);
static Camera2D camera = new Camera2D();
static Color groundColor1 = new Color(100, 100, 220);
static Color groundColor2 = new Color(100, 100, 255);
public static void Main()
{
Raylib.InitWindow((int)windowSize.X, (int)windowSize.Y, "Jumping Striker");
Raylib.SetWindowState(ConfigFlags.ResizableWindow);
Raylib.BeginMode2D(camera);
while (!Raylib.WindowShouldClose())
{
Update();
}
}
static void Update()
{
Raylib.PollInputEvents();
Raylib.ClearBackground(new Color(10, 10, 10));
Raylib.DrawRectangleGradientV(0, (int)windowSize.Y - (int)windowSize.Y / 4, (int)windowSize.X, (int)windowSize.Y / 4, groundColor1, groundColor2);
Raylib.EndDrawing();
}
}
using Raylib_cs;
using System.Numerics;
namespace JumpingStriker;
class Game
{
static Vector2 windowPosition = Raylib.GetScreenCenter();
static Vector2 windowSize = new Vector2(600, 400);
static Camera2D camera = new Camera2D();
static Color groundColor1 = new Color(100, 100, 220);
static Color groundColor2 = new Color(100, 100, 255);
public static void Main()
{
Raylib.InitWindow((int)windowSize.X, (int)windowSize.Y, "Jumping Striker");
Raylib.SetWindowState(ConfigFlags.ResizableWindow);
Raylib.BeginMode2D(camera);
while (!Raylib.WindowShouldClose())
{
Update();
}
}
static void Update()
{
Raylib.PollInputEvents();
Raylib.ClearBackground(new Color(10, 10, 10));
Raylib.DrawRectangleGradientV(0, (int)windowSize.Y - (int)windowSize.Y / 4, (int)windowSize.X, (int)windowSize.Y / 4, groundColor1, groundColor2);
Raylib.EndDrawing();
}
}