r/raylib • • 15h ago

I published my Raylib + C# game on Steam - Hack 42: Typing Incremental

21 Upvotes

Hi everyone, I've been working on this little game in C# and Raylib for about 9 months and finally pushed the release button on Steam last week.

It's a mixture of an incremental game and a typing game where you hack computers to fight the bad guys. It's quite short but still quite fun (1,5 to 3 hours, depending on your typing speed). If you are interested: https://store.steampowered.com/app/4622190/Hack_42_Typing_Incremental/

Kotaku featured it as the indie of the week: https://kotaku.com/hack-42-incremental-typing-game-review-indie-of-the-week-steam-pc-2000758839

Some thoughts on using Raylib and C# for this:

  • For the type of game I've been working on Raylib was a really good fit. It's really easy to get started, because the API is so easy to pick up. And it also covered all the needs of my game that go a bit beyond the basic usage:

    • off-screen rendering
    • custom shaders for bloom, CRT, etc.
    • text rendering + glyph info for animated text
  • C# had no Raylib bindings that supported compiling to web (at least at the time I've looked, maybe things have changed in the meantime). So I've build my own, turned out to be pretty straight forward.
  • C# has hot code reload and if you structure your code to be reloadable the Raylib + C# combo allows for really nice fast iteration.

Some general thoughts on programming small games without game engines:

  • Keep things simple, depending on your game you probably don't need an ECS, or any entity system at all. I've just used scene structs that hold the game state and have corresponding update/render functions that I dispatch to from the game loop via a switch statement. That made things easy to understand and debug. I did not miss a generalized entity concept at any time.
  • Invest a bit of time into making UI programming comfortable if your game has a lot of it. I've build my own immediate mode GUI with an automatic layout system (basically my own crappy version of https://github.com/nicbarker/clay). It took a lot of time initially but made programming UI way more bearable!
  • Have a set of animation helpers to easily add juice to your game:

  • On a similar note: having an easy way to spawn particles is pretty handy too. Most of the particles in my game are just spawned by a simple Spawn(position, velocity, scale, color, lifetime, delay, rotation, sprite) function.
  • If it fits the style of your game invest time into making reusable and composable text animations (mine are heavily inspired by Balatro), it brings a bit movement into your static UI screens.
  • Pack all your sprites into an atlas and have an easy way to draw them. For smaller games like mine a single atlas is enough and you never have to worry about texture switching when drawing a lot of sprites. I'm packing them at runtime using a simple and fast algorithm (just a naive row packer) so that I don't need to have a build step.

Also one thing to watch out for and that caught me by surprise in the last moment: Microsoft decided to block my executable shortly before the release with its "Smart App Control". There is seemingly no way to know why exactly a given executable is getting blocked. I've had to shell out about 130€ for a certificate to sign my executables (a very painful process btw).


r/raylib • • 19h ago

The whole story.

24 Upvotes

Rain, snow, shine, or disappearing in a cloud of powder – the show must go on.


r/raylib • • 1d ago

Coding Dragon Curve fractal using C & Raylib

Thumbnail
youtube.com
4 Upvotes

In this video, I code a Dragon Curve fractal using C and Raylib.

The approach is quite simple:

I take the last point as a pivot, then rotate the remaining points 90 degrees around it. Finally, I connect the new points to create the next iteration of the fractal.


r/raylib • • 2d ago

[Pog] haven't posted in a while here, showing off progress of combat in the game, raylib-cs 8.0

34 Upvotes

Soldiers fight in impulses, try to rest up when tired, skill and weight allows pushing. Soldier might be knocked back and get up.

Still working on impacts and feel.


r/raylib • • 2d ago

Help Decoupling Gameplay From Screen Size

6 Upvotes

I am working on a clone of the arcade game asteroids to learn C and Raylib, but I ran into a problem. If the game is played in different screen sizes, the player can see more space and thus, asteroids might seem like they are spawning too close to them.

How would I go about making the gameplay not/less dependant on the screen size and resolution?


r/raylib • • 2d ago

The Planewalker's Guild: you can now take torches off the wall and throw them. Including into oil barrels.

4 Upvotes

r/raylib • • 2d ago

getting VRAM usage

2 Upvotes

is there a way to get the VRAM usage by my program?


r/raylib • • 3d ago

I just released my forth full game made with raylib on Steam

153 Upvotes

You can check it out on Steam here if you are interested: https://store.steampowered.com/app/4790660/Moose_Builders/

This is my first game that has multiplayer. That has been a really fun experience building.

Feel free to ask any questions about the development of the game.


r/raylib • • 2d ago

autobahn (Raylib)

Post image
28 Upvotes

r/raylib • • 2d ago

Another question about artificial intelligence.

6 Upvotes

I just watched a video about how "times are changing," and I’d like to hear your take:

In the past, using AI felt like hiring interns people who barely understood the subject and that was the quality of the result you got. Today, AI seems to have improved significantly. Perhaps tomorrow, you might want your own version of GTA; you blink, and TADA it’s there, perfectly optimized and tailored to your exact specifications. In a few months, people might actually prefer AI-generated products, while looking down on anything crafted by hand.

So, what do you a C++, Rust, Zig, or C# developer who has built your own game engine (or the infrastructure to run your game) think about this? Do you plan to keep working without AI, use it solely as a learning tool, or lean into it to have AI do all the job?

Edit 0:

Sure, creating a video game as long as it’s a hobby you enjoy and find fun is a good thing.

Do you think the transition from ASM to C (or another programming language) is similar to what we might see next? What will a developer look like in 10 years? Will they be using Markdown editors? Will artificial intelligence truly be treated as a tool rather than a replacement? Or will we simply disappear from the field and end up becoming fishermen, chefs, or something else entirely?

Edit 1:
I’ve just read several news items about AI and watched a number of videos featuring AI developers and workers, and I feel much more at ease. It’s clear to me that AI isn’t a profitable business there are heavy losses, it consumes a massive amount of electricity, and there’s a constant need to upgrade equipment and GPUs.


r/raylib • • 2d ago

New GUI and content, as well as updated gameplay for my autobattler.

26 Upvotes

r/raylib • • 3d ago

I made a shooting game about bouncing lasers.

51 Upvotes

You can play it in your browser: https://aren227.itch.io/beyond-the-wall

Also Github repo available: https://github.com/aren227/beyond-the-wall-client (C++)

Thank you!


r/raylib • • 4d ago

My First Raylib Game - Snake

Post image
67 Upvotes

r/raylib • • 4d ago

Drawing textures randomly works and doesn't when trying to render a linked-list of elements

4 Upvotes

I'm trying to make a toy image editor using Raylib and C++ and ran into this problem.

When I try to render the layers of my project, there's a chance that they just wouldn't render at all, and yes the textures are loaded in.

I have a Canvas class that holds a reference to the first element of the linked-list where the layers of the project are. This class also has a method to add a new element to the list.

Canvas::Canvas(int width, int height){
    rt = LoadRenderTexture(width, height);
    rec =  {0.0f, 0.0f, (float)width, (float)(-height)};
} 

void Canvas::AddLayer(LayerObject* newLayer){
    if (newLayer == nullptr) {
        std::cerr << "[WARNING] Trying to add a null layer\n";
        return;
    }

    if (layers == nullptr) {
        layers = newLayer;
        return;
    }
    
    LayerObject* it = layers;
    while (it->next != nullptr){
        it = it->next;
    }
    it->next = newLayer;
    it->next->prev = it;

}

void Canvas::DrawLayers(){
    BeginTextureMode(rt);
        ClearBackground(WHITE);
        LayerObject* it = layers;
        while (it != nullptr){
            it->Draw();
            it = it->next;
        }
    EndTextureMode();
}

// ...

I'm suspecting that the Add() method is the culprit, but when I use the Add method in the constructor for debugging purposes, it works completely fine and renders the layer 100% of the time.

I tried checking to see if the DrawLayers() method was the culprit but printing how many layers the loop rendered turned out fine.

Here are some important methods of my RenderLayer

RasterLayer::RasterLayer(Vector2 position, const char* path){
    texture = LoadTexture(path);
    position = position;
    size = (Vector2){(float)texture.width, (float)texture.height};
}

void RasterLayer::Draw(){
    // TODO: add rotation
    //       add cropping
    //       use DrawTexturePro
    DrawTexture(texture, position.x, position.y, WHITE);
}

Any help would be appreciated. Thanks!


r/raylib • • 4d ago

how do i load a texture unto a wall in c# raylib?

0 Upvotes

i have insane trouble with this and i cant seam to do it, can anyone share the code or a tutorial on how to do this? would be appreciated, also i use the latest version of raylib.


r/raylib • • 5d ago

I made a lightweight shader helper for raylib 3d - RSF3D

Post image
17 Upvotes

Hi everyone!

  • I have been working on RSF3D (Raylib Shader Forward 3D), a lightweight, easy-to-use that helps to add lights, fog, and skybox.
  • Features:

    • Blinn-Phong and Gouraud.
    • Point, directional, spot lights.
    • Linear, exponential and exponential squared fogs.
    • Skybox.
  • My goal is to provide a simple helper for games, educations, simulators,... without bringing a complicated rendering.
  • GitHub: RSF3D - Nam-python

I'd love to hear your feedback, suggestions and ideas for improvements!

Thanks!


r/raylib • • 5d ago

Classic 2048 game variant I made in C and Raylib.

Thumbnail
gallery
26 Upvotes

Move tiles with the arrow keys. Matching tiles can merge, and a merge can trigger further merges in the same move: for example, 2 2 4 8 becomes _ _ _ 16 directly in a single right click rather than _ 4 4 8.

Other tiles can block movement and merging. For example, 2 4 2 _ becomes 2 4 _ 2 instead of _ 2 4 2 as the end 2 blocks preceding 2 4 from sliding to the right, while 4 8 _ _ becomes 4 _ _ 8 instead of _ _ 4 8 as 8 blocks 4 from sliding to the right.

check out the code on github.


r/raylib • • 6d ago Bravo

Made this raylib game in C about throwing cubes at cats

Post image
26 Upvotes

So in the game you can throw this cube at the cat.

There is also a fence so you don't start standing on nothing, and of course, a ground.

It's still in beta but here's the repo:

https://github.com/donutoreocomputer-arch/meow-cubes


r/raylib • • 7d ago

I wrote flappy bird game on my own raylib ecs engine

99 Upvotes

r/raylib • • 8d ago

Four single-header helpers and a six-platform ship template for raylib C games

19 Upvotes

Hi all,

I've published five small MIT-licensed add-ons for raylib games written in C. Each has a demo that runs in the browser.

  • raylib-canvas-kit: draw at one fixed resolution and show it at any window size (letterbox, pixel-perfect, fill or stretch), with mouse and touch mapped back. One 130-line header. Demo
  • raylib-touch-kit: an on-screen analog stick and buttons for phones and tablets. Multi-touch, drawn with shapes, no assets. One header. Demo
  • raylib-debug-kit: a JSON-lines event log, screenshots on demand and seeded repeatable runs, switched on by command-line flags. One header. Demo
  • raylib-dev-kit: developer modes built into the game: a sound board, an asset gallery and your own sandboxes. One header. Demo
  • raylib-ship-kit: a template that builds one C codebase for macOS, Windows, Linux, the browser, iPhone and iPad with one command each, through to App Store review. Demo

All five are built against raylib 6.2. Feedback and bug reports are welcome.


r/raylib • • 9d ago

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

20 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 • • 10d ago

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

91 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 • • 10d ago

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

Post image
486 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 • • 10d ago

Added an infinite repeating background to my 2D engine

27 Upvotes