Tutorial overview
In this tutorial you build Starfall: the main menu of a small game, with a profile panel that shows the rounds the player played and a settings popup that remembers its values. Each lesson starts from a program that runs, points at what it lacks, and closes the gap.
The lessons
Section titled “The lessons”| Lesson | You build | You practice | Code at the end |
|---|---|---|---|
| 1. Set up the project | A window with the game title | A UI, a font, the program loop | setup |
| 2. Build the main menu | The title and three buttons | Nodes, children, the design canvas | menu |
| 3. Lay out the profile panel | A column of buttons and the profile panel | Flex and grid layouts | layout |
| 4. React to the player | Hover colors, a settings popup, a shortcut, tooltips, Quit | Events, popups, the keyboard | interaction |
| 5. Keep the state | Rounds that fill the panel | Signals, derived values, rebuilding a list | state |
| 6. Save the settings | Settings that survive a restart | Stores | settings |
| 7. Polish with effects and motion | Rounded corners, shadows, a hand pointer, a panel that slides in | Effects, cursors, animation | polish |
What you need
Section titled “What you need”- A project set up as in Installation, with the LWJGL 3 dev jar.
- A font with a regular and a bold face, as TrueType or OpenType files. The captures use Montserrat.
The Quick Start tours the topics that the lessons practice: read it first if you have not.
How the lessons work
Section titled “How the lessons work”Each lesson shows the code it changes, with the changed lines highlighted, and the complete file when most of it changes. Each lesson edits the same files.
The last column of the table links the complete code at the end of each lesson, a program that runs on its own.
To start a lesson from there, or to compare your code, copy the folder of the lesson before it; polish is the finished game.
In the repository, each folder keeps a package of its own, com.example.tutorial.<folder>, so that the seven programs live side by side: when you copy one into your project, change its package to com.example.starfall.
Each lesson ends with a challenge and its solution, and with links to the Learn pages that explain what you used. The tutorial never explains a notion in depth: follow the links when you want the full picture.
