AI generated code counts as AI generated assets. As a rule of thumb, if you have to directly put in any generative AI output into your game, such as copy-pasting code, then it's not allowed. If not, then it is.
If you use AI as a source of information, but write the code yourself, that is allowed. What isn't allowed is for the AI to make or modify the code for you. Same as at university, it wouldn't be allowed to have someone else do your programming assignment for you.