AI creates Snake game: Devra
We're going to make this snake game right here without doing any code and, I think, without even typing. Here we are in Devra, and I've obviously been using Devra to make Devra. I've got two front-end and back-end projects set up. Let's just make a new one that we'll call "JavaScript Snake Game," a JavaScript implementation of the classic game of Snake.
Usually, you might start with a project, but in this case, we're starting with nothing. When we select our directory, we're just going to say "New Folder" and name it "JS Snake." Oh, I just typed it. Well, I'll type some things. We're going to create this project, and then when you have a project, that means you can have tasks like new features. But we're just starting out, so in this case, the task is going to be to create all files necessary for this game.
We're going to hit "Create and Start," and it's going to go. It's consulting the AI as to what to do next. First, it's going to look in the directory and find there's nothing there. Then it usually comes up with some sort of proposal about what to do next. Okay, here we are. The proposal is to make these three different files: the main index file, the style.css, and then the main JavaScript file for the game. We'll say that plan looks good, and at this point, it's going to be like, "All right, I'll make those files."
Here comes the index file. It creates that file, and then you'll see that in our folder we now have the index.html. Next, we're going to create the style.css, and we'll see that pop up in our folder. The JavaScript is going to be significant, so it might take a little while. I might cut ahead to that. All right, here we are. The JavaScript's ready. It creates that file, shows up here, and then we cross our fingers. Let's see how it turns out.
All right, it's got a score, it's got a snake. Let's hit the arrow keys and see what happens. Oh my God, it's perfect! Oh my God, this is amazing. Oh, this looks so good. Score two, score three. This is a great speed. The colors look great. I didn't have to specify any of this.
Well, I want to put this up on GitHub on the Devra account. Go to Devra for more information and to get this app and to start making your own games. All right, we'll end on that.
View the video