So @timbeaudet challenged his viewers to make an Asteroid-like game, and I needed a reason to try #Godot out more. We sometimes play typeracers on his stream so I decided to give making a typing game a go!
So @timbeaudet challenged his viewers to make an Asteroid-like game, and I needed a reason to try #Godot out more. We sometimes play typeracers on his stream so I decided to give making a typing game a go!
Instantiating bullet scenes and tweening them towards the asteroid, and only removing the asteroid when the last bullet hits it!
Now that the word disappears when the last bullet hits, rather than when you finished typing it, let's colour the word green as a visual indicator that it's finished!
Took me like an hour to get the hearts to line up in the HBoxContainer thing and be spaced properly... Layout in #Godot is confusing, sometimes clicking the anchor shortcuts makes the node move around in the parent, and sometimes it just does nothing O_o
Anyway, there's a fail condition! It's a real game now right?
Oh my god, I finally figured out one of the reasons why layouting things in #Godot is terrible. In order to right-align or center text, you need to constrain the text to a specific width! What‽
Without a width, text grows towards the right, unbounded by any maximum size. That's how left-align works. So why can't it grow towards the left, aka right-align, unbounded? Or grow both ways, for center-align?
Why is having a fixed width a requirement for center and right-align, but not left-align?
Anyway, finally got the WPM display to be right-aligned, by providing a width...
Also found the ShaderMaterial and added a subtle starry background with some twinkling stars 🌟
This feels like a hack, but it seems to work, creating a SubViewport around an object to take a "screenshot" of it into a texture and then multiple sprites with its own region of the texture == word go boom 💥
But getting used to how #Godot thinks, I probably missed a "split Node into multiple segments" button somewhere :P
I managed to get rid of the stutter by instantiating the scene into a SubViewport and then deleting it after a frame 😅
Also the Steam #Typing Fest 2026 just started, and I'm participating! You can go play the #demo right now!
Started implementing different typing modes.
Some words you have to type backwards, which is surprisingly hard to do!
And instead of actual words, sometimes you get a collection of random letters!
@tsjost Yeah, this is silly. I don’t even see what the limitation would be, because you can shape the text normally, decide what the width is, and then align text lines to whatever side the user wants.
For single line, at least, you can simply align the node itself to grow left or in both directions.
@yurisizov Whoa, so aligning the label node with anchor on the right side, makes the text grow towards the left, aka right-aligned, despite the label having "Horizontal Align: Left" specified. This adds another layer of confusion :D
(I understand that it's the content of the box, not the box itself, being left-aligned, but it's still weird having two different things determining growth direction)
Thanks!
@tsjost Actually, the anchor is not directly responsible for the grow direction! You’re probably using the quick anchor presets and those set the most sensible grow direction with them. But you can set it to custom and then the grow direction section will become visible for you to configure however you like. It’s true for every anchored node.
It probably helps to ignore the fact that you’re growing a label specifically and just think of the control’s box growing with content, whatever it is.
I guess this horizontal alignment behavior stems from old-school CSS intuition, where people regularly had exactly the same problems with alignment of any object, particularly centering.
With CSS, you generally had text containers' widths defined explicitly and properly, and in that "box model" context, text alignment worked out nicely as intended, as you were always aligning relative to the dimensions of the enveloping box, not growing willy-nilly all over the place and ruining your page layout with enlarged text or whatever.
Godot seems to lean heavily into existing CSS styling paradigms, to rely on that already built intuition. I would not call that beyond stupid.
However, different alignment modes would be nice, as I can totally understand how "just grow leftwards or from the center!" would come in handy in gamedev as opposed to rigid page layout land.
Then again, you'd probably end up with a year-long battle over what to make the default. 🙄
@tsjost
Yeah, I agree with you there, my white-knight reflex just got triggered a little. :)
The commenters on the issue seemed open for a constructive change/addition. Doesn't seem to be too sexy of a contribution, though.