Can AI code Flappy Bird? Watch ChatGPT try

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

We kindly ask /u/WheatyTruffles to respond to this comment with the prompt they used to generate the output in this post. This will allow others to try it out and prevent repeated questions about the prompt.

Ignore this comment if your post doesn't have a prompt.

While you're here, we have a public discord server. We have a free Chatgpt bot, Open Assistant bot (Open-source model), AI image generator bot, GPT-4 bot, Perplexity AI bot.

So why not join us?

PSA: For any Chatgpt-related issues email support@openai.com.

ChatGPT Plus Giveaway | Prompt engineering hackathon

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/AutoModerator πŸ“…οΈŽ︎ Apr 09 2023 πŸ—«︎ replies

ChatGPT made some mistakes that needed human fixing, but overall it did a decent job of developing a game step by step.

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/WheatyTruffles πŸ“…οΈŽ︎ Apr 09 2023 πŸ—«︎ replies

It just continues to amaze me every day.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/Tonyhillzone πŸ“…οΈŽ︎ Apr 09 2023 πŸ—«︎ replies

This is unbelievable! Basically anyone can create simple games they come up with now.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/ScottyDoesAI πŸ“…οΈŽ︎ Apr 09 2023 πŸ—«︎ replies
Captions
I wanted to know if chat GPT could make a video game so I asked it to make Flappy Bird for me but we're gonna have one rule I'm not gonna write a single line of code any code that we use is going to be written by chat GPT I'm just going to copy paste it over this could go very wrong I wrote a brief description of all the components that go into Flappy Bird real quick it spit out a six step plan to make Flappy Bird in the unity game engine so following the instructions for steps one and two we're gonna set up an empty game project and add our art for the background and the bird which brings us to step three which is to write a script to give life to the bird so it can flap its wings while flying to the right but we're not going to write the script chat GPT is we're just going to copy paste the script over it works but there's a problem the bird is flying off the screen so we're gonna ask chatgpt to fix that and write us some code to have a camera follow the bird as it moves to the right but you may have noticed that the bird is flying off the background that was a mistake I made setting up the background in the first place so I'm going to chalk that one up to human error my bad with a quick adjustment we now have a script working great at this point I realized we don't want the game to start right away when the game loads we have to wait for the player to click at least once to flap their wings before the bird starts moving otherwise you go barreling into the ground as soon as the game starts as per our main rule I had chat GPT right all of the code to delay movement until the player had flapped their wings for the first time and success the game now Waits until the first click and then you can flat flat flap your heart away have you been wondering where the art we've been using came from since chat GPT is writing all of the code well if you haven't guessed already the art is generated by AI as well I fed rough block out sketches into mid-journey and had it fill in the details for the background environment the bird and the pipe Ops this brings us to step number four things are going to get really interesting in Step 4 obstacle pipes are going to start appearing chat GPT has given us instructions to hook up the physics for the pipe which will cause the bird to collide with the pipe which is how the game's going to end but as I was reading the instructions chat GPT had provided this line caught my eye chat GPT was planning to create the obstacles off to the right of the screen that seems fine but then it proposed moving the pipes left at a constant speed I can see why it suggested that since the pipes do appear to move to the left when you're playing you see the bird and Camera are already moving to the right so the pipe should actually remain stationary and allow the bird to fly up to them I pointed this out to chat GPT and chat GPT agreed you're right it said and it proceeded to correct itself I copy pasted the code back in and now it works great except wait wait what's going on the birds flipping around like uh like like some kind of cuckoo bird this is the first curveball that I'm gonna throw at chat GPT because this was not part of the original design specification we're going to ask it to rotate the bird based on whether the bird is moving up or down without any hesitation chat GPT said sure you want the bird to tilt up and down you got it and it gave me the code to do so and now we've got this awesome little bird that tilts Up and Down based on the direction it's moving rather than spinning around like a pinwheel and that brings us on to step number five to implement game over and scoring conditions what I really like about this process is that while chat CPT is taking care of the code I get to focus my attention on design work I get to position tax elements on the screen I decide the distance between the pipes or the exact tuning numbers for how hard the bird flaps its wings so now we have scoring working but if you'll notice the points are actually incrementing before I get to the pipe that seems wrong I actually want the score to increment when the player passes through the Gap in the pipes so we're going to ask chatgpt to adjust the code to give us more control over the exact moment in time that the point is awarded to the player the player now gets points when they actually pass through the pipe at this point I realized that we're missing a ground for the game the ground and Flappy Bird is really helpful to provide that constant sense of forward movement other than the pipes the ground was not part of the original specification but I said nope we're gonna need it I let Chachi PT know that we're going to be adding a ground to the game and it gave me step-by-step directions for how to set up a never-ending ground the bird would be able to crash into and now we have an infinitely long ground along the bottom of the screen reinforcing that sense of forward movement and then move on to step six which is to have a game over screen come up when the player makes a collision with the pipe or with the ground our coding assistant chat GPT didn't hesitate to provide us with detailed instructions as well as all of the code to set up the game over screen once again I was able to focus on the design elements like deciding what font size and color to use the sizing of the buttons and then paste the code that chatgpt had provided me to make the whole thing work and now we have a proper game over screen but wait there's one problem after the game over screen pops up the player input is still being received which means the bird can jump up after it has fallen to the ground that's kind of ridiculous so I told chat GPT that when the game over screen pops up we need to stop the camera and stop movement so that the player shouldn't be able to control the bird anymore but here's another mistake chat GPT made there was a simple coding error and the game wouldn't run at all I just told chatgpt that the error existed to see what it would do polite as always it apologized for the error and provided the correction after following its instructions we now disable player input when the game over screen is reached now this is where we're going to get to our second curveball we're going to add a high score system let's see how well chat GPT adjust to this brand new request after we had basically finished all six steps of the original plan I copy pasted all the code it had provided me but watch what happens when I run the game with the new high score code enabled I scored two points on this Flappy Bird run but my high score was only listed as zero chat gbt wrote all this complicated logic with a simple error I told chat GPT I thought the problem was with the add score function and it replied you're right it's almost like we're working together we now have a high score system that works on this round I got a high score of nine and the score is retained between rounds so could somebody with no coding knowledge use chat GPT to make a game probably not yet but we're getting there I'm definitely going to repeat this exercise with more complicated game Types on future AI models so I hope you'll join me for that in the meantime happy gaming making
Info
Channel: candlesan
Views: 7,311,637
Rating: undefined out of 5
Keywords: games made here, candlesan, Wyatt Cheng, game design, game development, Chat GPT, ChatGPT, GPT4
Id: 8y7GRYaYYQg
Channel Id: undefined
Length: 7min 26sec (446 seconds)
Published: Thu Mar 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.