How to make a Space Invaders game with GPT-4 and your own AI generated textures
- Write this prompt in GPT-4: “write p5.js code of space invaders with my own textures”
- Go to https://openprocessing.org create and save sketch (you’ll need to save it before uploading any texture files). Copy paste code from GPT-4
- Ask GPT-4 to generate textures by writing this prompt “Provide prompts so I can use those to generate images in Midjourney image generator for a ship, a bullet and an alien” Use https://clipdrop.co/remove-background…… to remove backgrounds before uploading images to OpenProcessing
- Replace the names of files with your filenames
- Run the program
- If something doesn’t work ask GPT-4 to fix it (you can copy an error and paste into GPT-4) like you would ask a human programmer If after many attempts you can’t fix all the problems with the code, ask it to “forget everything and start over”
- To learn a bit of programming write these prompts to GPT-4: “Act as my programming teacher. Tell me an algorithm of Asteroids game in detail and make names of functions and explain what each of these functions will do. Don’t write the code just yet.” and then ” Can you describe the algorithm overall for a 10-year-old child”
Space Invaders, it was a tiny bit harder than Asteroids; a tutorial on how to make Asteroids game here:
Credit: https://twitter.com/icreatelife