From the course: Intermediate Java: 5 Projects
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Creating a game loop - Java Tutorial
From the course: Intermediate Java: 5 Projects
Creating a game loop
- [Shaun] All right, so let's take a look at our next project, which is going to be creating a WordGuessingGame. Now, in order to create really any kind of turn-based game, the first thing that we're going to have to do is set up a game loop. And that's what we're going to be taking a look at in this video, but first, let's actually create a new package for this new project by saying new, and then we'll go to package, and I'm going to call this com., and then I'm going to use my name, but as I said, you can use your name. And then I'm going to say .wordgame. And now that we have that, inside here, I'm actually going to create two different classes. One of these classes is going to be sort of the main entry point for the application, but unlike with the dice simulator that we just created, we're going to want this one to be a little bit more modular. So we're going to create a separate class that will represent the game itself. So we'll start off by saying new Java class, and we'll…