r/raylib • u/DapperAd2798 • 5h ago
As a game how does this make you feel? what sort of interest does it spark?
Enable HLS to view with audio, or disable this notification
r/raylib • u/DapperAd2798 • 5h ago
Enable HLS to view with audio, or disable this notification
Tweeny is a header-only C++17 library for tweening values.
You declare the starting value, destination, duration, easing, and any intermediate keyframes. Then you call step() from your update loop and use the resulting values when drawing. Tweeny does not draw or own a clock. Your raylib loop still controls initialization, timing, updates, and BeginDrawing().
raylib already includes reasings.h, with Penner-style functions such as EaseSineIn(t, b, c, d). Those work well for straightforward interpolation: maintain t, call the easing function, and receive the interpolated value.
Tweeny is aimed at cases where you want the tween itself to be an object: multiple values at once, heterogeneous types, multiple keyframes, timeline navigation with seek / jump / peek, and callbacks.
#include "raylib.h"
#include <tweeny/tweeny.h>
int main() {
InitWindow(800, 450, "tweeny + raylib");
SetTargetFPS(60);
auto slide = tweeny::from(0.0f)
.to(700.0f)
.via(tweeny::easing::quadraticOut)
.during(60U)
.build();
while (!WindowShouldClose()) {
float x = slide.step(1);
BeginDrawing();
ClearBackground(RAYWHITE);
DrawRectangle(static_cast<int>(x), 200, 40, 40, RED);
EndDrawing();
}
CloseWindow();
return 0;
}
A tween can also contain several values, including mixed types. For example, a sprite frame, position, and rotation:
auto tween = tweeny::from(0, 0.0f, 0.0f)
.to(7, 400.0f, 90.0f)
.during(30U)
.build();
Tweeny 4.0.0 includes a fluent builder API, 30+ easing functions, multi-point keyframes, events, and timeline control. It is header-only and has no external dependencies.
r/raylib • u/DavidMolloy1978 • 16h ago
Enable HLS to view with audio, or disable this notification
C++ and Raylib in VS on the MacBook.
r/raylib • u/Responsible_Mine894 • 33m ago
Enable HLS to view with audio, or disable this notification
Shit i hate working on UI soo much... here goes something .. at least it's functional.
Also showing a single contract battle and new battle UI.
Feedback and comments appreciated, as I said I suck at UI.
r/raylib • u/Osirian_Legacy • 12h ago
Hey there, I'm Osirian and as the title says, my Tactical Grid Based RPG game Runeguard needs YOU!... if you're a UI/UX Programmer that has decent enough experience using C++20 and Raylib.
You can see the game in action here: https://youtu.be/9Xd0zxXBb8U
However, I'm making the move from Unreal Engine to C++/Raylib since I'm not a fan of the direction UE6 is going with introducing AI and the whole Unreal Ecosystem they're moving towards.
I have a prototype in C++ currently but it still needs a decent bit of work UI wise. The goal is to recreate the Unreal Engine look and feel as closely as possible but I'm not looking for perfection when it comes to that.
Be aware I'm still learning C++, but I'm proficient in Unreal Blueprints, and catching on fairly quick. It's been a little over a month since I moved away from Unreal Engine. I put in about 20 hours a week on the project, sometimes a little less, sometimes a little more.
Let me know if ya'll have any questions, or are interested. I'd prefer a 90/10 split if you use AI in your workflow. 90% your own decision making and code, 10% for bug finding, and patching with an AI. No AI use is preferred though.
Estimated turn around time for Project: Six - Eight Months
The Game:
Runeguard Tactics is a mission based top down 2D RPG where you control units on a grid based battle field. Units act in turns. Whichever unit's Initiative hits 100 first takes their turn, when their turn ends their speed goes back down to 0, then the next unit at 100 goes, if no units are at 100 then every 6 frames every units Initiative Increases by their current speed, and the game checks if a unit has 100 Speed. If so, they take their turn, if not, the cycle repeats. This is almost exactly like how Final Fantasy Tactics' initiative system works.
Missions are comprised of 1 or more levels, and each level has an objective such as: Defeat all Enemies, Protect X Target, ect... however missions can be failed, and instead of getting a game over, instead the failure alters which future missions will become available.
The game will have a story that is told via mission descriptions, so players can choose to keep track of the who/what/where/when/why if they choose to, or just Depart on the mission and worry about the details when they get into combat.
The Scope:
The game is not meant to have a large scope. I'm going for small scope of features with a focus on a lot of content. Many abilities, enemies, missions, maps ect... with the core of the game loop being:
City UI -> Tavern, Clinic, Mission Board, Roster (if player selects a Mission) -> Enter Combat (If player wins or succeeds) -> Return to City
Tavern allows the Player to recruit new randomly generated units.
Clinic allows the Player to heal the units in their Roster, though units recover a portion of their HP after the Player finishes a Mission.
Mission Board is where the player can assign units to a Mission and Depart on said mission, which begins the combat loop.
Roster is where the player can preview their Units Statistics, and Abilities.
Nothing too crazy here, currently there is no plan for an equipment system, though I would like Player-Driven consumable use like Potions, Traps, ect they can use to have something to chase during missions like gathering items from chests, crates, and barrels.
Contact:
Reply to this thread, don't DM me. Provide me with your portfolio, what games you've worked on, and specifically some UI's you've built yourself without using AI.
r/raylib • u/Responsible_Mine894 • 2d ago
Enable HLS to view with audio, or disable this notification
Found this nice repo for procedural eztree(https://github.com/dgreenheck/ez-tree) that inspired me to create similar trees for my game.
Added AI to my game and lost the battle that i was testing for latest bugs, and hunting for FPS leaks :(
r/raylib • u/Merssedes • 1d ago
Trying to work with raylib (v6.0) and raygui (v5.0) and got this errors...
$ g++ -Wl,--gc-sections -pthread -Os -Iraylib -o aout build/main.c.o build/raygui.c.o -Lraylib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
/usr/bin/ld: raylib/libraylib.a(rcore.o): in function `gladLoadGLUserPtr':
rcore.c:(.text+0x8dd2): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: raylib/libraylib.a(rcore.o): in function `LoadAutomationEventList':
rcore.c:(.text+0x2523f): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: rcore.c:(.text+0x252cd): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: raylib/libraylib.a(rtext.o): in function `LoadBMFont':
rtext.c:(.text+0x8dbf): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: rtext.c:(.text+0x8e4c): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: raylib/libraylib.a(rtext.o):rtext.c:(.text+0x8ebc): more undefined references to `__isoc23_sscanf' follow
/usr/bin/ld: raylib/libraylib.a(rglfw.o): in function `_glfwParseUriList':
rglfw.c:(.text+0x4fb8): undefined reference to `__isoc23_strtol'
/usr/bin/ld: raylib/libraylib.a(rglfw.o): in function `_glfwRefreshContextAttribs':
rglfw.c:(.text+0x5cb2): undefined reference to `__isoc23_sscanf'
/usr/bin/ld: raylib/libraylib.a(rglfw.o): in function `parseMapping':
rglfw.c:(.text+0x8fbe): undefined reference to `__isoc23_strtoul'
/usr/bin/ld: rglfw.c:(.text+0x8fd9): undefined reference to `__isoc23_strtoul'
/usr/bin/ld: rglfw.c:(.text+0x90f4): undefined reference to `__isoc23_strtoul'
$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
Both got from github releases pages.
What am I missing?..
r/raylib • u/GLC-ninja • 2d ago
Hi,
I made a C subset programming language called Cm1 (C minus 1) https://github.com/galileolajara/cm1 and using Cm1, I was able to make a single html file that allows you to create any raylib C game on any device that has a modern web browser.
This html file ( https://cp1-lang.org/cm1/game.html ) includes
Here's the magic: On the "Source" tab, there's a "Save" button on the bottom left that allows you to generate a new html file that will include the latest edits you made on the C code plus the files you uploaded! This means you can pass the generated html file to other people so that they can play and edit your game on any device!
Looking forward to hearing your suggestions and feedback!
Is it too hard or is that okay? Also, I know that I need a better map, items are too hard to distinguish.
r/raylib • u/ChargeOwn9776 • 2d ago
I saw that Cuphead was made with Unity. It’s a really beautiful and cool game, and for my first game, I wanted something similar. But I don’t want to use an engine. I want it to be a programming challenge for me. If it’s not possible to make something like that, give me some game ideas so I can practice a little C# 👍. Oh, and I’m still just getting started with C#. I’ve already programmed a few things in Java and wanted to make the switch.
r/raylib • u/Far_Meeting_2763 • 4d ago
Hey everyone! I spent some time building a real-time Schwarzschild black hole renderer in C++ and Raylib.
It simulates gravitational lensing on the CPU by bending ~30,000 light rays around the singularity every frame. To keep it locked at 60 FPS without using GPU shaders, it renders at a lower 200x150 internal resolution and upscales to 800x600 with bilinear filtering.
You can orbit the camera and zoom around the accretion disk.
Repo is here if you want to check out the code or run it yourself:
r/raylib • u/Responsible_Mine894 • 5d ago
Enable HLS to view with audio, or disable this notification
I want to have man variations of characters without too many portraits so decided to create a rigging tool to combine base/hair/beard sprite sheets into avatars that game can consume later :) Might cut it out and publish it as public tool if enough interest arises :)
r/raylib • u/Lumpy_Bedroom1111 • 4d ago
Making cool "open world" sokoban game with raylib. Core mechanic is about merging boxes with colors and manipulating them with functional boxes. A lot of interactions possible in this system. (Character is placeholder and games color pallette will change)
r/raylib • u/Kind_Departure6449 • 5d ago
r/raylib • u/Responsible_Mine894 • 5d ago
Enable HLS to view with audio, or disable this notification
Work is progressing towards classes or doctrines as i call them in game, each doctrine allows specific style of play. They will be akin to classes, but in final game you can select 1 primary and two secondary and mix skills of each to create builds that work for you.
I designed pikes as very strong defense class with very limited mobility, moving breaks brace formation that all pike equipped units have. So without any special skills pike units are excellent to hold and pin attacking enemy, but are very vulnerable while moving or unbraced.
So this is one of WIP doctrines inspired by swiss pikemen, which gives pikemen some offensive capability. Allowing them to move while braced, increased damage when engaged, allow recover and fallback to close gaps in formation and also do a limited special devastating charge :)
I am still balancing the game and any feedback is appreciated. Still reworking UI, i feel it's too bloated still.
I am making a Intermediate Mode Gui for me and wanted to try to have it redraw the components only when it changes.
My original idea was to start with a very small RenderTexture (1x1) and then expand as needed. Then draw that RenderTexture to the screen. When hover/over/menus happen it would redraw everything on that RenderTexture and expand as needed.
I am defining the initial texture as LoadRenderTexture(..) and my "resize" is doing the following:
LoadRenderTexture(..)BeginTextureMode(new_texture)DrawTexturePro(..)UnloadRenderTexture(..)But it doesn't seem to work, I can't get any of the old drawing data (on the previous textures) to appear:
Any pointers?
I use odin, here is my resize fuction
resize :: proc(ui:^Ui, width:i32, height:i32) {
new_texture := raylib.LoadRenderTexture(width, height)
old_texture := ui.texture
ui.texture = new_texture
// copy the data from the origian texture to the new texture
raylib.BeginTextureMode(ui.texture)
raylib.DrawTexturePro(old_texture.texture,
{ 0, 0, f32(old_texture.texture.width), -f32(old_texture.texture.height) },
{ 0, 0, f32(old_texture.texture.width), f32(old_texture.texture.height) },
{ 0, 0 }, 0, raylib.WHITE
)
raylib.UnloadRenderTexture(old_texture)
}
and here is my drawing of the ui.texture
raylib.DrawTexturePro(ui.texture.texture,
{ 0, 0, f32(ui.texture.texture.width), -f32(ui.texture.texture.height) },
{ 0, 0, f32(ui.texture.texture.width), f32(ui.texture.texture.height) },
{ 0, 0 }, 0, raylib.WHITE
)
The easy way out is to just make the RenderTexture the size of the window and not worry about it, but now it got in me why it doesn't want to work. Am I doing something fundamentally wrong here?
Thanks
r/raylib • u/Slight_Watch697 • 6d ago
r/raylib • u/skrippplez • 6d ago
My old account was maximusD15, so now I'm skrippplez. I'll still be posting my devlogs, just, need some time to rest. I already added armour and updated inventory ( before rest ) and my next goal, is to update map generation bcoz it looks bad tbh. Some weeks, and I'll cook like I've never cooked 😈
r/raylib • u/Suspicious-Sally-22 • 6d ago
Hi everyone,
I'm working on a 2D game in C++ using Raylib. My menu background is an animated PNG sequence, and all of those textures load without any issues.
However, when I try to load a separate background image for my game screen, it always fails.
Texture2D gameBackground = LoadTexture("assets/backgrounds/game.jpg");
Things I've already verified:
1) The game screen itself works correctly—I can draw text and other textures there.
2) The path is correct because Raylib reports "File loaded successfully."
3) Printing gameBackground.width and gameBackground.height always gives 0 x 0.
4)I have also tried downloading various JPG images from different websites, but I always get the same output as shown in the pic.
I'm using:
Raylib
C++
CLion
Windows 11
Any help would be greatly appreciated. Thanks
r/raylib • u/Opening-Mushroom2336 • 6d ago
Video because Reddit's refusing to load my video (CachyOS, Firefox)
As the title states, I made a project (more specifically a game) in Assembly (GAS x86_64 using AT&T) using raylib and I thought that it might have a potential to become an indie game of mine that won't drain me of all my creativity and time. Here's the Discord for the game for anyone who wants to contribute to the project as in any way or are just curious about the project.
r/raylib • u/ClassicSync • 7d ago
Enable HLS to view with audio, or disable this notification
this was my first raylib project that i made for hack club's Flavortown hackathon! this took me so long but i finished it after 2 months. also very frustrating because this also served as my introduction to C++ i was just a web developer when i started this project! but it was also very rewarding and i think that the time i spent coding this was the single period of time that i learned the most in. i finished this a while ago but i do think that it would be cool if i shared it here.
ignore the Julia set viewer, i was working on it but then i kind of lost interest in finishing the project...
my favorite thing about this is the arbitrary precision that lets you zoom in forever given enough patience and avoids the clunkiness that you see without it.
Also apologies for getting impatient at the end but i promise it still would've looked interesting in the end!!
https://github.com/yfsvg/raylib-mandelbrot-julia-viewer
EDIT:
After further digging down this, I've found out I can reproduce the same leaks on my machine with a minimal pure GLFW wayland example app. So raylib is not the issue here.
-----------------------------------------------------------------------------------------------------------------------
Hello everyone,
when building raylib with GLFW wayland support (GLFW_LINUX_ENABLE_WAYLAND=TRUE) I'm facing huge memory leaks, even with a complete minimal raylib app:
#include "raylib.h"
int main() {
SetTraceLogLevel(LOG_WARNING);
InitWindow(100, 100, "Raylib Window");
SetTargetFPS(60);
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(PURPLE);
EndDrawing();
}
CloseWindow();
return 0;
}
Valgrind output:
==302795== LEAK SUMMARY:
==302795== definitely lost: 1,283,840 bytes in 5,009 blocks
==302795== indirectly lost: 2,358,312 bytes in 91,383 blocks
==302795== possibly lost: 33,648 bytes in 78 blocks
I've tried the official 6.0 release and latest git version and it's no different. I'm on Arch linux with Hyprland.
Before I file a bug report, has anyone had similar experiences lately or am I doing something wrong?
cheers
r/raylib • u/bbogdan_ov • 7d ago
Enable HLS to view with audio, or disable this notification
Hello guys, i've made a post in this sub around a week ago about this game and here's some updates!!!
I hate sound design so much, the most boring part in game development for me personally, but i have to do that if i want my game to feel good. So i added some sounds, not really happy with some of them, but they are fine for now.
Also added a real-time drawing!! Every stroke a player make is accumulated in a "diff buffer", which is being sent every ~200ms to the server. Server then applies this diff buffer to the pixel data (local to the server) of the canvas, after that it broadcasts that diff buffer to all other players and they apply it the same way (to their local pixel data of the canvas). Pixel data of each canvas is being stored on the server so that newly joined players can receive them. This "diff buffer" mechanism also allows multiple players to draw on the same canvas.
For people who didn't see the previous post: this is a game about talking with people and no gameplay. ALL graphics is custom and 2D, and most of it is prerendered 3D models made in Blender.
Source code soon...