Search found 64 matches

by celes
Tue Sep 15, 2026 5:59 pm
Forum: Langdev
Topic: I love nameof
Replies: 0
Views: 378

I love nameof

There's this little builtin operator in C# called "nameof". You give it a thing and it returns you the name of the thing, in a string...

So, nameof(MyClass) returns the string "MyClass" . And on first glance that's pretty useless, because if you have to type the name of the thing, why not type two ...
by celes
Tue Sep 15, 2026 5:37 pm
Forum: Game Programming
Topic: Snippets: The IDE feature from the 1990s nobody told you about
Replies: 2
Views: 526

Re: Snippets: The IDE feature from the 1990s nobody told you about


Probably not many people realizes that, because for programming languages, it's easy to find an extension that gives you language snippets for a while loop, or a for-each loop.


Yes!! This so much. I wrote this yesterday thinking: People will think I'm dumb and this is obvious because everybody ...
by celes
Mon Sep 14, 2026 4:21 pm
Forum: Game Programming
Topic: Snippets: The IDE feature from the 1990s nobody told you about
Replies: 2
Views: 526

Snippets: The IDE feature from the 1990s nobody told you about

I started honing up my snippet skills at the start of the development of Iris Blade and I'm really happy with the results. I think it was a random message by Kampffrosch that got me into it, actually, so I wanted to say thanks! :heart_orange:

In VSCodium snippets are quite easy. Browsing the docs ...
by celes
Wed May 13, 2026 9:14 pm
Forum: Game Programming
Topic: I give up, min / max just doesn't fit my brain
Replies: 4
Views: 47872

Re: I give up, min / max just doesn't fit my brain


... or even :blobcatgiggle:

clamp(x, min=Float.MIN_VALUE, max=Float.MAX_VALUE) = clamp(x, min, max)


so you can write

this.x = clamp(this.x + Time.deltaTime, max=maxValue)



Ohhhh I read this before during the stream and didn't realize what you meant. You mean clampMax for min and ...
by celes
Wed May 13, 2026 9:09 pm
Forum: General
Topic: Interest check: Cool forum features
Replies: 1
Views: 36022

Re: Interest check: Cool forum features

To procrastinate on making maps you should at least have the map editor open :akko_blushmmpf:

But I like all these features! Old cringey forum nostalgia is what this is all about :blobcatnodfast:
by celes
Wed May 13, 2026 12:44 pm
Forum: Game Programming
Topic: I give up, min / max just doesn't fit my brain
Replies: 4
Views: 47872

Re: I give up, min / max just doesn't fit my brain

Kampffrosch wrote: Wed May 13, 2026 12:36 pm I always read

Code: Select all

a.min(b)
as "a should be at least b"
Yes, the method syntax makes min/max far worse. But at_least / at_most would read so nice in method syntax... I'm gonna add this and see if I end up using it! :nkoThink:
by celes
Wed May 13, 2026 12:32 pm
Forum: Game Programming
Topic: I give up, min / max just doesn't fit my brain
Replies: 4
Views: 47872

I give up, min / max just doesn't fit my brain

It's very common when writing game code to want to express the idea that this variable saturates at a certain value, for example:

this.x += Time.deltaTime;
if (this.X > maxValue) {
this.X = maxValue;
}


Now you see how my brain likes to think in terms of the "maximum value" this variable is ...
by celes
Mon Apr 20, 2026 7:03 pm
Forum: 2D Art
Topic: Turned a cheap usb numpad into a compact aseprite shortcut keyboard
Replies: 1
Views: 38110

Re: Turned a cheap usb numpad into a compact aseprite shortcut keyboard

Continuing with this, here's a little pic of my aseprite on-the-go setup!

image.png

I'll also say that I changed methods and I'm now no longer using hwdb but input remapper . This was also mentioned in David Revoy's post, but the issues have been fixed since then and it now works like a charm ...
by celes
Sat Apr 18, 2026 5:56 pm
Forum: 2D Art
Topic: Turned a cheap usb numpad into a compact aseprite shortcut keyboard
Replies: 1
Views: 38110

Turned a cheap usb numpad into a compact aseprite shortcut keyboard

Not exactly 2D art, but it's about art and I draw 2D, so here it goes :akko_shrug:

Inspired by this blog post by the krita legend David Revoy, I too turned a cheap USB numpad into a shortcut keyboard. This is quite intuitive to use, even if I've just been a couple hours at it.

This thing is ...
by celes
Tue Apr 07, 2026 7:55 am
Forum: Langdev
Topic: The power of discriminated unions is exhaustivity, not the unions
Replies: 0
Views: 50432

The power of discriminated unions is exhaustivity, not the unions

For those who aren't in the loop, C# has finally released a preview version for union types! ! There's a catch though.

To clarify, union here means discriminated union, not a C-style union. It's what Rust calls an enum when the variants of the enum have payloads and not just a tag. I think zig ...