MenacingMecha,
@MenacingMecha@mastodon.gamedev.place avatar

finally properly clicked for me what "lambdas capture their environment" means, as in "you can define things in-scope before the lambda is defined, and then those things will be captured in the lambda even after they've gone out of scope"

every example I tried to look at previously just ended up being like verbose syntax vomit

practical gdscript example:

var x := 1
node.example_signal.connect(func(): print(x + 1))

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines