• RhythmGameQml
  • StandardGameplayFlow
  • StandardGameplayFlow QML Type

    Starts play, handles exit and retry, saves scores and opens results. More...

    Import Statement: import RhythmGameQml

    Properties

    Signals

    Methods

    Detailed Description

    Place one instance inside the gameplay screen and bind gameplay to the supplied GameplayContext. The flow handles ready audio, startup, Escape, quick retry, and speed and cover controls. Your theme draws the playfield. See the gameplay lesson for an example.

    StandardGameplayInput, StandardGameplayAttemptState and StandardGameplaySpeedControls are already included. Do not add another copy beside the flow. It inherits the screen's enabled state, so inactive screens cannot start play or navigate.

    Add an intro or outro

    Keep startReady false until your intro finishes. The flow then plays the ready sound and waits for startDelayMillis before requesting play.

    For an outro, keep finishReady false, start the animation in finishRequested, and set finishReady to true when it ends. The flow still saves scores and opens results. An explicit exit skips this wait. Reset per-stage visuals in stageActivated.

    Handle courses and retries

    Each chart opens a normal result, including course stages. Closing a stage result advances the course. After the last stage result, the flow opens the course summary; closing it returns to selection. A single chart returns to selection after its result closes.

    Retry buttons bind to retryAvailable and call retry with false for a new random pattern or true for the same pattern. Standard quick retry is unavailable for courses, autoplay, replay, battle and Arena.

    In Arena, the flow requests play when presentation is ready; the session waits for the shared start time. The flow submits the score before showing results and releases the result presentation when that screen closes.

    Recover from a failed transition

    If the result screen cannot open, presentationFailed is emitted and the saved scores are kept. Call retryTransition to try again without saving twice. closing may therefore run more than once. Use it to stop or clear visuals; do not navigate from its handler.

    Property Documentation

    attempted : bool [read-only]

    Reports whether the current stage has received a scoring hit.


    dismissOverlayAction : var

    Called as dismissOverlayAction() before exit. Return true after closing an overlay to keep gameplay open.


    exitEnabled : bool

    Controls whether Escape and exit are accepted.


    exitFeedbackSource : url

    Sets the exit sound for an attempted play. Use an empty URL to disable it.


    finishReady : bool

    Controls whether a naturally finished chart may open its result.


    gameplay : GameplayContext

    Supplies the screen context for a single chart or a course.


    readySoundSource : url

    Sets the ready sound. Use an empty URL to disable it.


    retryAction : alias

    Calls retryAction(samePattern) instead of the standard restart.


    retryAvailable : bool [read-only]

    Whether a supported retry can be requested from a button or gesture.


    retryChoosing : bool [read-only]

    Reports whether the retry gesture is waiting for a release choice.


    retryEnabled : alias

    Controls whether quick retry and the Start+Select gesture are accepted.


    retryHoldDurationMillis : alias

    Start+Select hold time in milliseconds.


    speedControlsEnabled : alias

    Enables standard Start, Select and scratch speed/cover controls. Disable for custom controls.


    startDelayMillis : int

    Sets the delay in milliseconds after ready audio, or the full delay when no audio is available.


    startReady : bool

    Allows ready audio and startup when true. Bind it to the completion of your intro.


    Signal Documentation

    closing()

    Emitted before leaving so the theme can clean up. It can repeat if result creation fails.

    Note: The corresponding handler is onClosing.


    finishRequested()

    Emitted when play finishes naturally. Start your outro here and bind finishReady to its completion.

    Note: The corresponding handler is onFinishRequested.


    presentationFailed()

    Emitted when result creation fails. Call retryTransition() to reuse the saved scores.

    Note: The corresponding handler is onPresentationFailed.


    stageActivated()

    Emitted once per active stage, before standard startup.

    Note: The corresponding handler is onStageActivated.


    Method Documentation

    cancelRetry()

    Cancels the held retry choice.


    exit()

    Leaves an unattempted local chart without saving. If a scoring hit was made, finishes the attempt and opens results. Arena follows its session's exit rules. Returns false while disabled, choosing a retry, or unable to leave. dismissOverlayAction may handle the request while keeping play open.


    retry(samePattern)

    Retries with the same pattern when samePattern is true, otherwise a new one. Returns false when retryAvailable is false. A handled request returns true even if loading fails and the current screen stays.


    retryTransition()

    Retries a failed result transition without saving the score again.