melonJS scenes and flow
Sets up melonJS stages, state changes, transitions, pausing and tweens so game flow runs without timing bugs.
Claude's review
9/10 Excellent melonJS stage and state guidance with real traps like loading state, same state change and unpaused stage update.
We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.
In detail
Use this skill for scene structure and game flow in melonJS — Stage subclasses, the state manager, transitions, pausing, the update loop, timers and tweens. Covers onResetEvent versus the constructor, state.set before state.change, the camera and world lifecycle per stage, and pause-aware timing. Triggers on: Tween, easing, fade out, flash, pulse, punch, shrink back, ease in, ease out, animate over time, countdown in update, Stage, state, state.set, state.change, state.transition, pixelate, iris, star wipe, Trigger transition, retry level, play again, restart, state.reload, state.pause, pauseOnBlur, resumeOnFocus, onResetEvent, onDestroyEvent, onActivateEvent, onDeactivateEvent, PLAY, MENU, LOADING, update loop, GAME_UPDATE, timer, setTimeout, setInterval, Tween, freeze, setFocusEvents, focusEvents, host or portal pause, YouTube Playables onPause, save, save.add, setStorage, createCloudStorage, flush, localStorage, cloud save, high score persistence.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: melonjs-scenes-and-state
description: "Use this skill for scene structure and game flow in melonJS — Stage subclasses, the state manager, transitions, pausing, the update loop, timers and tweens. Covers onResetEvent versus the constructor, state.set before state.change, the camera and world lifecycle per stage, and pause-aware timing. Triggers on: Tween, easing, fade out, flash, pulse, punch, shrink back, ease in, ease out, animate over time, countdown in update, Stage, state, state.set, state.change, state.transition, pixelate, iris, star wipe, Trigger transition, retry level, play again, restart, state.reload, state.pause, pauseOnBlur, resumeOnFocus, onResetEvent, onDestroyEvent, onActivateEvent, onDeactivateEvent, PLAY, MENU, LOADING, update loop, GAME_UPDATE, timer, setTimeout, setInterval, Tween, freeze, setFocusEvents, focusEvents, host or portal pause, YouTube Playables onPause, save, save.add, setStorage, createCloudStorage, flush, localStorage, cloud save, high score persistence."
license: MIT
---
# Scenes, game state and timing
## Stages and the state manager
A `Stage` is a screen. Register it against a state id, then change to it:
```js
import { Stage, state } from "melonjs";
class PlayScreen extends Stage {
onResetEvent(app) { /* build the scene */ }
onDestroyEvent(app) { /* tear it down */ }
}
state.set(state.PLAY, new PlayScreen()); // register first
state.change(state.PLAY); // then switch
```
Built-in ids: `state.LOADING`, `state.MENU`, `state.READY`, `state.PLAY`,
`state.GAMEOVER` (no underscore), `state.GAME_END`, `state.SCORE`,
`state.CREDITS`, `state.SETTINGS`, `state.DEFAULT`. `state.USER` (100) is the
base for your own ids — `const CUTSCENE = state.USER + 1`.
**Build scene content in `onResetEvent`, not the constructor.** `onResetEvent`
runs on *every* entry to the state; the constructor runs once. Scene content
created in the constructor exists once and is not rebuilt when you return.
`onResetEvent(app)` receives the `Application` — use that rather than importing
the global `game`.
Extra arguments to `state.change` are forwarded:
```js
state.change(state.PLAY, false, { level: 2 }); // → onResetEvent(app, { level: 2 })
...From melonjs's repository, MIT licence.
Related skills
-
Checked
Godot game optimisation
Profiles a Godot game and fixes common slowdowns in draw calls, physics and memory so it runs more smoothly.
7/101 credit -
Checked
Game Audio Mixing
Sets up game audio buses, volume sliders, music ducking and adaptive music for Godot, Unity or FMOD.
8/101 credit -
Checked
Game camera tuning
Builds and tunes follow, orbit and first person game cameras in Godot or Cinemachine so they stop jittering.
8/101 credit -
Checked
Game Enemy AI
Designs enemy AI with perception, pathfinding and steering so enemies chase fairly and never get stuck.
8/101 credit -
Checked
Blender asset optimisation
Cuts Blender assets down to each platform's budget with LODs, decimation and texture atlases before export.
7/101 credit -
Checked
Three.js game UI
Designs HUDs, menus, pause screens and touch controls for Three.js games that read well on any screen.
7/101 credit