Skip to content

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.

Starfall at the end of the tutorial: every part of it is a node you write yourself.
LessonYou buildYou practiceCode at the end
1. Set up the projectA window with the game titleA UI, a font, the program loopsetup
2. Build the main menuThe title and three buttonsNodes, children, the design canvasmenu
3. Lay out the profile panelA column of buttons and the profile panelFlex and grid layoutslayout
4. React to the playerHover colors, a settings popup, a shortcut, tooltips, QuitEvents, popups, the keyboardinteraction
5. Keep the stateRounds that fill the panelSignals, derived values, rebuilding a liststate
6. Save the settingsSettings that survive a restartStoressettings
7. Polish with effects and motionRounded corners, shadows, a hand pointer, a panel that slides inEffects, cursors, animationpolish
  • 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.

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.

Report a problem with this page