This website provides detailed information about all core classes in PadManiacs. Use this reference when creating addons to understand available APIs and modification points.
[heading: "Introduction"]PadManiacs is a lightweight rhythm game that brings the StepMania experience to web and mobile devices with a retro pixel art aesthetic. The game features core rhythm gameplay mechanics of StepMania, a popular open source rhythm game.
PadManiacs supports community-created modifications through an add-on system. Add-ons can:
[list] * Replace game assets (arrows, backgrounds, UI elements) * Add new behaviors and gameplay mechanics * Extend the game with new features [/list] [heading: "How addons work"]An addon is a folder that contains data that the game loads at startup, overwriting the assets and default game behavior.
In order for an addon to be considered valid, it must include the [code: "manifest.json"] file, a file that defines metadata, which parts of the game must be modified or extended, as well as the data and the code that must be loaded.
Add-ons are stored at a subfolder [code: "Addons/"] under local storage folder. All Addons you develop must be inside this folder so you can test them in the game.
[heading: "Tutorials"]Learn how to create and modify PadManiaX with these step-by-step tutorials.
[list] * Getting Started with Modding - Learn the basics of creating your first addon * Understanding the Manifest Format - Complete guide to manifest.json structure * Asset Replacement Tutorial - How to replace game graphics and sounds * Creating Behavior Scripts - Adding custom gameplay logic * UI Modification Guide - Customizing menus and interfaces [/list] [heading: "Global Scope"]The following global variables and constants are available throughout the game and can be used in addons:
[subheading: "Constants"] [table header] [ Name | Type | Value | Description ] [ COPYRIGHT | string | "(C) RETORA 2025" | Copyright notice ] [ VERSION | string | "v0.0.5" | Current game version ] [ DEBUG | boolean | false | Global debug flag, can be enabled for development ] [ ENVIRONMENT.UNKNOWN | string | 'UNKNOWN' | Environment detection constant ] [ ENVIRONMENT.NWJS | string | 'NWJS' | NW.js desktop application environment ] [ ENVIRONMENT.CORDOVA | string | 'CORDOVA' | Apache Cordova mobile environment ] [ ENVIRONMENT.WEB | string | 'WEB' | Standard web browser environment ] [ CURRENT_ENVIRONMENT | string | (detected) | Current runtime environment ] [ FONTS | object | font configurations | Predefined font configurations for text rendering ] [ WINDOW_PANELS | array | ["1"] | Available UI window panels ] [ CORDOVA_EXTERNAL_DIRECTORY | string | "PadManiacs/" | External directory path for Cordova ] [ NWJS_EXTERNAL_DIRECTORY | string | "data/" | External directory path for NW.js ] [ EXTERNAL_DIRECTORY | string | (environment-specific) | Current external directory path ] [ ADDONS_DIRECTORY | string | "Addons" | Addons directory name ] [ SONGS_DIRECTORY | string | "Songs" | Songs directory name ] [ ENABLE_PARALLEL_LOADING | boolean | false | Enable parallel asset loading ] [ MAX_PARALLEL_DOWNLOADS | number | 16 | Maximum parallel downloads ] [ MAX_PARALLEL_ADDON_LOADS | number | 3 | Maximum parallel addon loads ] [ ENABLE_ADDON_SAFE_MODE | boolean | true | Enable addon safe mode for error protection ] [ ENABLE_UI_SFX | boolean | false | Enable UI sound effects ] [ DEFAULT_SONG_FOLDERS | array | [...] | Default built-in song folders ] [/table] [subheading: "Global Variables"] [table header] [ Name | Type | Description ] [ game | Phaser.Game | Main Phaser game instance ] [ gamepad | Gamepad | Unified input system instance ] [ backgroundMusic | Object | Background music controller ] [ notifications | NotificationSystem | Global notification system instance ] [ addonManager | AddonManager | Addon management system ] [ Account | Object | User account data with settings and progress ] [/table] [subheading: "Global Functions"] [table header] [ Name | Parameters | Description ] [ detectEnvironment | () | Detects and returns current runtime environment ] [ saveAccount | () | Saves account data to localStorage ] [ bootGame | () | Initializes and starts the Phaser game ] [/table] [heading: "API"]PadManiaX was built using Phaser CE, with Cordova for mobile file access and NW.js for desktop builds. See the documentation: Cordova Docs and NW.js Docs, plus Phaser CE Docs.
The game code is divided into different classes. All classes are accessible in the scope of addon file. Each of them plays a role, some more important than others. For example game screens visual or abstract elements, data managers, etc.
[subheading: "Game States"] [table header] [ Name | Description ] [ Boot | Load critical assets, initialize input system, then start loading the game. Addons are not ready to be used yet ] [ Load | Initialized with a set of objects representing assets that need to be loaded, when all assets are loaded it starts a specific game screen. Still addons can't be used ] [ LoadCordova | Initialize Cordova on mobile devices, initialize file system, then start loading add-ons ] [ LoadAddons | Initializes the addon manager and loads addon resources, then start loading default songs ] [ LoadLocalSongs | Loads Free Play songs and starts title screen, at this points addons are initialized but the game will not invoke addon behaviors ] [ Title | Title Screen, waits for user input and starts MainMenu ] [ MainMenu | Main Menu screen, song selection, user songs, settings and extras ] [ LoadExternalSongs | Loads songs stored in local storage, the game will not invoke addon behaviors ] [ SongSelect | Initialized with a set of songs, displays song selection menu, starts gameplay screen with the song selected ] [ Play | Gameplay screen, initialized with a single song ] [ Results | Judge your performance, display scores and save new records ] [/table] [subheading: "Game Classes"] [table header] [ Name | Description ] [ Logo | Logic for title screen logo ] [ Text | Tiny pixel text with various effects ] [ WindowManager | Handles creation, focus and removal of UI Windows (like Settings window), you'll need to work with this class if you want to make multiple windows ] [ Window | A single UI Window ] [ CarouselMenu | Great vertical carousel menu, supports colors, item data, auto scrolls if text is too long ] [ OffsetAssistant | Logic for the offset assistant screen ] [ BackgroundGradient | Pixelated gradient using as UI background ] [ FuturisticLines | Logic for futuristic background lines ] [ LoadingDots | Logic for dots animation used in loading screens ] [ ProgressText | A version of the Text class that appears in loading screens ] [ NotificationSystem | Notification manager, accessible globally as [code: "notificationSystem"]. Handles notifications in all game screens ] [ Lyrics | Logic for LRC lyrics ] [ Visualizer | Base class to create stats visualizers in-game ] [ AcurracyVisualizer | Logic for acurracy visualizer graph ] [ AudioVisualizer | Logic for audio frequency visualizer ] [ BPMVisualizer | Logic for BPM changes and stops visualizer ] [ Metronome | Logic for metronome sound ] [ Player | Almost all gameplay logic is handled by this class ] [ Gamepad | Unified input system, handles keyboard, touchscreen and gamepad input ] [ LocalSMParser | Process StepMania .SM files of default songs, resolve it's dependencies and return and object that represents a song chart ] [ ExternalSMParser | Works similar to LocalSMParser but handles external songs ] [ AddonManager | Loads addons, applies behaviors, overrides default assets, enables, disables, hibernates or wakes addons. You should not modify this class ] [/table] [subheading: "File System Classes"] [table header] [ Name | Description ] [ FileSystemTools | Wrapper to class to interact with the file system, allows read/write access to the user files ] [ CordovaFileSystem | Logic for file access with Cordova Plugin File. It's used by FileSystemTools on Mobile ] [ NodeFileSystem | Logic for file access with Node.JS APIs, It's used by FileSystemTools on Desktop ] [ FallbackFileSystem | Rejects all file operations, It's used when file system access is not available. FileSystemTools will use this for Web ] [ NodeDirectoryEntry | Equivalent to DirectoryEntry class of Cordova Plugin File ] [ NodeFileEntry | Equivalent to FileEntry class of Cordova Plugin File ] [/table] [footer: "© Retora 2025"]