Second player gameplay instance for multiplayer
[heading: "Description"]Concrete Player subclass configured for the second player in multiplayer mode. Assigns gamepad2 for input, positions the chart on the right side of the screen, and binds P2-specific HUD elements for judgement, combo, score, and health display.
[heading: "Key Features"] [list] * Uses gamepad2 for input * Right-side screen positioning * P2-specific HUD elements [/list] [heading: "Constructor"] [table header] [ Parameter | Type | Description ] [ scene | Phaser.Scene | The Phaser game scene ] [ settings | Object | Gameplay configuration overrides ] [/table] [heading: "Properties"] [table header] [ Property | Type | Description ] [ gamepad | Object | Gamepad assigned to player 2 ] [ HEALTH_X | number | X position of player 2's health bar ] [ HEALTH_WIDTH | number | Width of player 2's health bar ] [ ACCURACY_BAR_WIDTH | number | Width of player 2's accuracy bar ] [ hud | Object | HUD container for player 2 ] [/table] [heading: "Example Usage (Modding)"] [codeblock javascript] // Creating a second player for head-to-head gameplay const p2 = new SecondPlayer(scene, { speedMod: "C-MOD" }); p2.update(); console.log(p2.score, p2.getScoreRating()); [/codeblock] [footer: "© Retora 2026"]