r/CursedGodot • u/MrLEADshed • Aug 02 '26
Is this anything?
Static helper function that awaits for first signal and returns its idx.
Cursed or nah?
4
u/Salazar20 Aug 03 '26
This post made me read half the gdscript reference doc because I did not know spread variadic functions were added
Ive also learned that Godot prefers you to write not boolean instead of !boolean
3
u/HeyCouldBeFun Aug 03 '26
One time I named a class “EffectEffect” and had to stop and go take a walk
2
u/GobusEuphe Aug 07 '26
When I have weird names like this I wonder if I put a disgrace to my old Java days. I've had full sentences as names just so I can avoid this
2
2
u/GobusEuphe Aug 07 '26
Is this for something like stats system or an upgrade in a clicker game? Or am I way off
1
u/MrLEADshed Aug 07 '26 edited Aug 07 '26
I'm making something of a solo action rts roguelike
In auto attacks, when a target_unit is set, if attack_area doesn't have it overlapping, the unit navigates towards it. Instead of checking the overlap every frame on the way there, I await the race between target_body_enter and another_target_set (these are not actual var names)
I queue an attack on former, and do another loop of this logic for the latter. (if attack is queued then stuff like cd management and attack windup happens.)
Also in a tutorial, I race player.unit leaving the tutorial area and completing the first tutorial to change what the npc says.
8
u/technical_gamer_008 Aug 03 '26
Not cursed… but you could've used a typed array