tabular,
@tabular@lemmy.world avatar

If speed is actually important then I would consider writing it in another language looking for someone else’s implementation (personally). I try to focus on readability and doing the simplest implementation. I’ve been trying to use better function/variable names to explain what is happening at a glance instead of reading the whole thing. Have you considered using map for array iteration? I am hoping even if people don’t know how this works the intended result is even more readable than an equivalent for loop:


<span style="color:#323232;">func _show_only_first_layer_dots():
</span><span style="color:#323232;">	var set_dots_visibility = func(layer): layer.get_node("Dots").visible = (layer == $Layers.get_child(0))
</span><span style="color:#323232;">	$Layers.get_children().map(set_dots_visibility)
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • [email protected]
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • TheResearchGuardian
  • KbinCafe
  • feritale
  • Socialism
  • oklahoma
  • SuperSentai
  • KamenRider
  • All magazines