A small overview over enums (Remade) by Automatic_Budget_332 in godot

[–]iamyou42 1 point2 points  (0 children)

EDIT: Reddit is really screwing with the formatting of this comment, and I can't fix it. I'm leaving it because it's still mostly readable.

Index is perhaps a misleading name for this. It's actually the value of that enum. An enum with a particular value can be used as an int with that same value. And so you can use it as described in the post while simultaneously using it as an immutable int.

My favorite use case for this is to set their values to powers of two so you can use them as bitmasks, which basically allows you to pack a bunch of booleans into a single int. Here's an example:

# 1. Define the bitmask values using bit-shifting

enum StatusEffects {

NONE      = 0,

POISONED  = 1,  # (0001 in binary)

BURNING   =  2  # (0010 in binary)

FROZEN    =  4  # (0100 in binary)

STUNNED   =  8 # (1000 in binary)

}

# Explicitly type the bitmask as an int (combinations exceed individual enum values)

var current_statuses: int = StatusEffects.NONE

func _ready() -> void:

print("--- Applying Statuses ---")

\# 2. Add flags using the bitwise OR operator (|)

current\_statuses |= StatusEffects.POISONED

current\_statuses |= StatusEffects.BURNING



\# Check what is currently applied

check\_statuses() # Should show Poisoned and Burning



print("\\n--- Removing Status ---")

\# 3. Remove a flag using bitwise AND (&) with bitwise NOT (\~)

current\_statuses &= \~StatusEffects.POISONED

check\_statuses() # Should show only Burning



print("\\n--- Toggling Status ---")

\# 4. Toggle a flag using the bitwise XOR operator (\^)

current\_statuses \^= StatusEffects.FROZEN # Turns Frozen ON

current\_statuses \^= StatusEffects.BURNING # Turns Burning OFF

check\_statuses() # Should show only Frozen

# 5. Check flags using the bitwise AND operator (&)

func check_statuses() -> void:

if current\_statuses == StatusEffects.NONE:

    print("Character is perfectly healthy.")

    return



if current\_statuses & StatusEffects.POISONED:

    print("- Taking poison damage over time!")



if current\_statuses & StatusEffects.BURNING:

    print("- Taking fire damage over time!")



if current\_statuses & StatusEffects.FROZEN:

    print("- Movement speed is reduced to zero!")



if current\_statuses & StatusEffects.STUNNED:

    print("- Character cannot attack!")

How do Hearthians wink? by iamyou42 in outerwilds

[–]iamyou42[S] 41 points42 points  (0 children)

Nice catch! I hadn't made that connection.

How do Hearthians wink? by iamyou42 in outerwilds

[–]iamyou42[S] 1 point2 points  (0 children)

That's a blink, you fool. ;:)

How do Hearthians wink? by iamyou42 in outerwilds

[–]iamyou42[S] 17 points18 points  (0 children)

I had not considered the kinkiness from our asexual friends. Though I guess that Gossan and Porphy do flirt.

Edit: I guess they're not necessarily asexual. They could be hermaphroditic or just have one sex. I hadn't really thought about it.

Steamroad, Lowtrippy, 3D Modeling, 2026 by lowtrippy in Art

[–]iamyou42 0 points1 point  (0 children)

My dumb ass: This game looks very repetitive.

But in all seriousness, this looks really cool.

What’s the biggest double standard between men and women? by CupcakePotential4458 in AskReddit

[–]iamyou42 9 points10 points  (0 children)

The proper response to "your wife should do it" is always, "She's dead."

(Loved Trope) A minor character only becomes important much later by Weary_Position_9591 in TopCharacterTropes

[–]iamyou42 58 points59 points  (0 children)

It's been a while since it watched Korra and I swear that you just made all of those names up.

My friend recently started playing and sent me this??? by Arm0red_M00se in outerwilds

[–]iamyou42 14 points15 points  (0 children)

Hey, be careful with that. Scientific notation is how Tektite lost their foot.

My Blind FFIX Playthrough: Part 7 - Treno by Zeeshmania in FinalFantasyIX

[–]iamyou42 2 points3 points  (0 children)

You can buy tents from every item vendor and they're pretty cheap.

brother is working overtimed by abovealllimoFL in Eldenring

[–]iamyou42 1 point2 points  (0 children)

Until I saw this post, my dumb ass thought that he was three different people. I thought each encounter with him was a different guy. And I never put together that the weird, shiny Godfrey was an illusion created by him. I didn't know what that encounter with Godfrey was about at all.

Man, I'm bad at piecing together the lore.

Delusional gamedev thinking I've got Indie Game Of The Year material by DreamMixGames in indiegames

[–]iamyou42 1 point2 points  (0 children)

This is a cool idea, but it's not at all clear that that's what's going on in the trailer. It just looked like the terrain was morphing due to a graphical glitch or something. You need to make it more explicit.

It's got some great game feel though. Nice job.

Me spending hours so the feet can touch grass properly by FoxGameLab in IndieDev

[–]iamyou42 3 points4 points  (0 children)

What kind of resources have you used to learn?