Bootstrap and structure an FXGL game application — set up GameApplication subclass, configure initSettings, initGameVars, initInput, initGame, initPhysics, initUI, and onUpdate. Use this skill when creating a new FXGL game, adding engine services, configuring window size/title, setting application mode, or wiring the game loop.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
La commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Explorateur de fichiers
3 fichiers
Affichage de SKILL.md
SKILL.md
Instructions source · Aperçu en lecture seule
name
fxgl-game-lifecycle
description
Bootstrap and structure an FXGL game application — set up GameApplication subclass, configure initSettings, initGameVars, initInput, initGame, initPhysics, initUI, and onUpdate. Use this skill when creating a new FXGL game, adding engine services, configuring window size/title, setting application mode, or wiring the game loop.
Every FXGL game extends GameApplication and launches via launch(args).
The engine calls lifecycle methods in strict order — honour that order or face NPEs.
Asset directory: all assets must be under src/main/resources/assets/. FXGL
auto-prefixes this path. Writing getAssetLoader().loadTexture("textures/player.png")
resolves to assets/textures/player.png on the classpath.
launch(args) is final — do not override it. Override lifecycle hooks instead.
initSettings runs before JavaFX Application.start() — avoid any JavaFX node
creation here.
Kotlin DSL: use import com.almasb.fxgl.dsl.* and GameApplication() — same hooks,
same order. The FXGLForKt file provides Kotlin-specific extension functions.
Application mode: always ship with ApplicationMode.RELEASE. The developer menu
and profiler are disabled automatically.
Module path for JavaFX: add --module-path and --add-modules javafx.controls,javafx.fxml
to JVM args in your build file if running outside a module-aware launcher.
initGameVars is mandatory for reactive properties: getip("score") throws
IllegalArgumentException if "score" was not declared in initGameVars.
World reset: calling getGameController().startNewGame() re-runs all init* hooks.
Avoid storing state in instance fields unless you reset it in initGameVars.