I don't recommend using AI to code or make anything for the final game. If you really want to use AI, the way to do it is to ask the AI to explain something you didn't knew or couldn't figure out. Then you can read it and write the code yourself in your own way. Don't just copy and paste. The AI will probably give you a really complicated solution but if you can understand the logic, you can write the code again using what you know in coding. This means that you have a lot of control over your game and if you are adding new mechanics or dealing with bugs you will have an easier time than using AI generated code, and you will be able to learn, improve your skills and also feel satisfied for it.
This is just a recommendation. You can do anything that is comfortable with you!