The only difference between a game and an engine being separate entities is if you take the exact same engine and use it to make another different game without making massive changes to the engine. Otherwise you're just making a game. So where do you need to stop the code generation?
I don't really buy the idea that it's fine to use generative AI for code and it's not fine for writing, dialogue, voice, music, models, or other art. Code is part of that creative process, even the stuff in the engine.