Player as export variable in level_generator script, instead of setup()

I’ve tried the challenge and I thougt I succeeded, however I’ve made my player instance in the level_generator script an export variable instead of using a setup method. I was wondering what the argument would be to create a setup method over using the @export method?

I checked the video and there are definitely several ways you could go about doing this, but in general, I find that the @export annotation is best left to variables that would need to be adjusted on a per-instance basis for game-design purposes, like configuring how fast a particular moving obstacle should go during its movement cycle. This is what they do better than anything else can.

Not suggesting Kaan’s way is perfect, but anything you can do dynamically with code is something you don’t have to do manually (and therefore accidentally forget or misconfigure!). “Set and forget” as they say =)

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms