Package-level declarations

Types

Link copied to clipboard
class ChirpyHopEngine(obstacleX: Double = INITIAL_OBSTACLE_X, obstacleKind: ChirpyObstacleKind = ChirpyObstacleKind.Antenna)

Chirpy Hop's rules, free of any drawing. Positions are fractions of the play field: x runs 0..1 left to right and y is height above the ground, so the same state renders at any size. Physics advances in fixed steps, so the outcome of a run does not depend on the frame rate.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class ChirpyHopUpdateStatus(val phase: ChirpyHopUpdatePhase, val message: UiText, val progress: Float?)

The update as the game's status band shows it. A null progress draws an indeterminate bar.

Link copied to clipboard

Backs ChirpyHopScreen, keeping the best score in UiPrefs.

Link copied to clipboard

Functions

Link copied to clipboard
fun ChirpyHopDialog(status: ChirpyHopUpdateStatus, bestScore: Int, onScore: (Int) -> Unit, onClose: () -> Unit)

Chirpy Hop over the update screen, with the update's progress kept in view. When the update finishes or fails the run freezes and a card sends the user back to the update screen. Back closes the game, never the update.

Link copied to clipboard
fun ChirpyHopPlayButton(onClick: () -> Unit, modifier: Modifier = Modifier)

Offers the game from an update's progress view.

Link copied to clipboard
fun ChirpyHopScreen(viewModel: ChirpyHopViewModel, onNavigateUp: () -> Unit, modifier: Modifier = Modifier)

Chirpy Hop with no update attached, opened from Settings.

Link copied to clipboard

The game is offered only while an update runs unattended. Null means the update needs the user (a file to save, a bootloader to review, a cancel back to Ready), so the game closes rather than covering the screen that asks.