0.118.0 (versionCode 309): Test Card Tangle, Orbi-Fax Codebreaker, Arcade Daily and the seasonal backdrops in one build

- Six more backdrops: Seaside Pier, Drive-In, Snowfall, Sakura Night, Retro Living Room, Moon Base
- Fit checks for the new games' buttons and every backdrop name
- docs/new-originals.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 11:30:38 +00:00
co-authored by Claude Opus 5.5
parent d4d9c80746
commit aab877afc9
7 changed files with 190 additions and 8 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ android {
applicationId = "tv.orbit.classic"
minSdk = 26
targetSdk = 36
versionCode = 308
versionName = "0.117.0-quiz-night"
versionCode = 309
versionName = "0.118.0-new-originals"
}
buildFeatures { compose = true }
// The finished build for the TVs (Paul, 6 November 2026: the test build stuttered on the box). Not debuggable, so
@@ -31,7 +31,9 @@ import kotlin.random.Random
*/
internal enum class ArcadeBackdrop(val title: String) {
DeepSpace("Deep Space"), Aurora("Aurora"), Rooftops("Rooftops"), SatelliteRing("Satellite Ring"),
Nebula("Nebula"), TestCardDusk("Test-Card Dusk"), Meadow("Meadow at Night"), Teletext("Teletext Grid");
Nebula("Nebula"), TestCardDusk("Test-Card Dusk"), Meadow("Meadow at Night"), Teletext("Teletext Grid"),
// The seasonal and channel set (approved 9 November 2026).
SeasidePier("Seaside Pier"), DriveIn("Drive-In"), Snowfall("Snowfall"), SakuraNight("Sakura Night"), RetroLivingRoom("Retro Living Room"), MoonBase("Moon Base");
companion object {
/** A saved choice, read back. Before the collection there were three: Night Sky (the default, so "each game's own" now), Nebula and Moonrise. */
@@ -145,6 +147,14 @@ internal fun Modifier.arcadeBackdrop(which: ArcadeBackdrop): Modifier = drawWith
else -> {}
}
val ringed = Offset(w * .16f, h * 1.02f)
// The seasonal set's shapes, made once.
val flakes = if (which == ArcadeBackdrop.Snowfall || which == ArcadeBackdrop.SakuraNight) starField(which.ordinal + 77, 110, w, h) else FloatArray(0)
val pierLights = if (which == ArcadeBackdrop.SeasidePier) FloatArray(14) { it * w * .045f + w * .32f } else FloatArray(0)
val crater = if (which == ArcadeBackdrop.MoonBase) Path().apply {
moveTo(0f, h); lineTo(0f, h * .78f)
for (i in 0..30) { val x = w * i / 30f; lineTo(x, h * (.78f + .025f * kotlin.math.sin(i * 1.3).toFloat() + .015f * kotlin.math.cos(i * 2.9).toFloat())) }
lineTo(w, h); close()
} else Path()
val teleCells = if (which == ArcadeBackdrop.Teletext) Random(99).let { m -> IntArray(40 * 24) { m.nextInt(100) } } else IntArray(0)
onDrawBehind {
fun starsAt(alpha: Float, div: Float) { for (i in 0 until stars.size / 3) drawCircle(Color.White.copy(alpha = alpha + stars[i * 3 + 2] / div), stars[i * 3 + 2], Offset(stars[i * 3], stars[i * 3 + 1])) }
@@ -211,6 +221,76 @@ internal fun Modifier.arcadeBackdrop(which: ArcadeBackdrop): Modifier = drawWith
flowers.forEach { (o, c) -> drawCircle(c.copy(alpha = .7f), 3f, o); drawCircle(Color(0xFFFFDE59).copy(alpha = .8f), 1.2f, o) }
windows.forEach { o -> drawCircle(Color(0xFFFFDE59).copy(alpha = .16f), 7f, o); drawCircle(Color(0xFFFFF2A8).copy(alpha = .8f), 1.8f, o) }
}
ArcadeBackdrop.SeasidePier -> {
drawRect(Brush.verticalGradient(listOf(BackdropNavy, Color(0xFF1C2E66)), 0f, h * .62f))
starsAt(.18f, 5f)
// The sea, the moon's path on it, and the pier with its string of lights.
drawRect(Brush.verticalGradient(listOf(Color(0xFF0B1E48), Color(0xFF061232)), h * .62f, h), Offset(0f, h * .62f), Size(w, h * .38f))
drawCircle(Color(0xFFF4F0DC), h * .06f, Offset(w * .2f, h * .2f))
for (k in 0 until 9) drawRect(Color(0xFFF4F0DC).copy(alpha = .25f - k * .025f), Offset(w * .2f - h * .05f + (k % 2) * h * .02f, h * (.64f + k * .035f)), Size(h * .1f - k * h * .008f, h * .008f))
drawRect(Color(0xFF0A1022), Offset(w * .3f, h * .58f), Size(w * .7f, h * .025f))
for (k in 0 until 10) drawRect(Color(0xFF0A1022), Offset(w * (.32f + k * .07f), h * .6f), Size(w * .006f, h * .12f))
drawRect(Color(0xFF0A1022), Offset(w * .82f, h * .5f), Size(w * .12f, h * .08f))
drawPath(Path().apply { moveTo(w * .8f, h * .5f); lineTo(w * .88f, h * .43f); lineTo(w * .96f, h * .5f); close() }, Color(0xFF0A1022))
pierLights.forEachIndexed { i, x -> drawCircle((if (i % 3 == 0) Color(0xFFFF4FA3) else if (i % 3 == 1) Color(0xFFFFDE59) else Color(0xFF35D6F2)).copy(alpha = .85f), 2.5f, Offset(x, h * .565f)) }
}
ArcadeBackdrop.DriveIn -> {
drawRect(Brush.verticalGradient(listOf(Color(0xFF0A0F2E), Color(0xFF231A4A))))
starsAt(.18f, 5f)
// The big screen glowing over a field of parked cars, as at the Orbit Drive-In.
drawRect(Color(0xFF15122E), Offset(w * .3f, h * .62f), Size(w * .02f, h * .3f)); drawRect(Color(0xFF15122E), Offset(w * .68f, h * .62f), Size(w * .02f, h * .3f))
drawRect(Color(0xFF9FB4FF).copy(alpha = .16f), Offset(w * .22f, h * .2f), Size(w * .56f, h * .44f))
drawRect(Color(0xFFDDE4FF).copy(alpha = .55f), Offset(w * .26f, h * .24f), Size(w * .48f, h * .36f))
drawPath(Path().apply { moveTo(w * .5f, h * .6f); lineTo(w * .2f, h); lineTo(w * .8f, h); close() }, Color(0xFF9FB4FF).copy(alpha = .05f))
drawRect(Color(0xFF0B0A1E), Offset(0f, h * .86f), Size(w, h * .14f))
for (k in 0 until 7) { val x = w * (.04f + k * .14f); drawRoundRect(Color(0xFF0B0A1E), Offset(x, h * .8f), Size(w * .1f, h * .07f), androidx.compose.ui.geometry.CornerRadius(h * .02f)); drawRoundRect(Color(0xFF0B0A1E), Offset(x + w * .02f, h * .76f), Size(w * .06f, h * .05f), androidx.compose.ui.geometry.CornerRadius(h * .02f)) }
}
ArcadeBackdrop.Snowfall -> {
drawRect(Brush.verticalGradient(listOf(Color(0xFF0A1A3A), Color(0xFF2A3A6A))))
// Snow falling (still: drawn once), hills of it, and a lit cottage window or two, for the Mistletoe season.
for (i in 0 until flakes.size / 3) drawCircle(Color.White.copy(alpha = .35f + flakes[i * 3 + 2] / 4), flakes[i * 3 + 2] * 1.4f, Offset(flakes[i * 3], flakes[i * 3 + 1]))
drawOval(Color(0xFFDDE6F5), Offset(-w * .2f, h * .74f), Size(w * .8f, h * .5f)); drawOval(Color(0xFFEFF3FA), Offset(w * .4f, h * .78f), Size(w * .9f, h * .5f))
drawRect(Color(0xFF1E2A50), Offset(w * .7f, h * .66f), Size(w * .1f, h * .13f))
drawPath(Path().apply { moveTo(w * .68f, h * .66f); lineTo(w * .75f, h * .58f); lineTo(w * .82f, h * .66f); close() }, Color(0xFFEFF3FA))
drawRect(Color(0xFFFFD27A), Offset(w * .73f, h * .69f), Size(w * .025f, h * .035f))
}
ArcadeBackdrop.SakuraNight -> {
drawRect(Brush.verticalGradient(listOf(Color(0xFF14102E), Color(0xFF3A1E4A))))
starsAt(.18f, 5f)
// A full moon, a blossoming branch across it, and petals drifting (still), for Orbit Sakura.
drawCircle(Color(0xFFFFF0F5).copy(alpha = .15f), h * .24f, Offset(w * .7f, h * .32f)); drawCircle(Color(0xFFFFF0F5), h * .17f, Offset(w * .7f, h * .32f))
drawPath(Path().apply { moveTo(0f, h * .2f); quadraticTo(w * .3f, h * .25f, w * .55f, h * .12f); lineTo(w * .56f, h * .14f); quadraticTo(w * .3f, h * .29f, 0f, h * .25f); close() }, Color(0xFF2A1A28))
for (i in 0 until 26) { val t = i / 26f; val x = w * .55f * t; val y = h * (.21f - .07f * t) + (if (i % 2 == 0) -1 else 1) * h * .03f; drawCircle(Color(0xFFFFB7D2), h * .022f, Offset(x, y)); drawCircle(Color(0xFFFF8FBF), h * .008f, Offset(x, y)) }
for (i in 0 until flakes.size / 3) if (i % 3 == 0) drawOval(Color(0xFFFFB7D2).copy(alpha = .6f), Offset(flakes[i * 3], flakes[i * 3 + 1]), Size(5f, 3f))
}
ArcadeBackdrop.RetroLivingRoom -> {
drawRect(Brush.verticalGradient(listOf(Color(0xFF1A1230), Color(0xFF2C1C3A))))
// A cosy room at night: patterned wallpaper, a lamp's glow, and an old telly glowing with Orbit's test card.
for (r in 0 until 8) for (c in 0 until 14) drawCircle(Color(0xFF3A2650).copy(alpha = .6f), h * .012f, Offset(w * (c + (r % 2) * .5f) / 14f, h * r / 8f + h * .04f))
drawRect(Color(0xFF231427), Offset(0f, h * .78f), Size(w, h * .22f))
drawCircle(Color(0xFFFFC27A).copy(alpha = .12f), h * .3f, Offset(w * .15f, h * .45f))
drawPath(Path().apply { moveTo(w * .11f, h * .38f); lineTo(w * .19f, h * .38f); lineTo(w * .17f, h * .3f); lineTo(w * .13f, h * .3f); close() }, Color(0xFFFFC27A))
drawRect(Color(0xFF3B2A1A), Offset(w * .148f, h * .38f), Size(w * .004f, h * .4f))
drawRoundRect(Color(0xFF4A3220), Offset(w * .55f, h * .48f), Size(w * .3f, h * .3f), androidx.compose.ui.geometry.CornerRadius(h * .03f))
drawRect(Color(0xFF4A3220), Offset(w * .57f, h * .78f), Size(w * .02f, h * .08f)); drawRect(Color(0xFF4A3220), Offset(w * .81f, h * .78f), Size(w * .02f, h * .08f))
val bars = listOf(Color(0xFFF4F6FB), Color(0xFFFFDE59), Color(0xFF35D6F2), Color(0xFF6EDCAA), Color(0xFFFF4FA3), Color(0xFFFF6B6B), Color(0xFFA77BFF))
val sw = w * .2f / bars.size
bars.forEachIndexed { i, c -> drawRect(c.copy(alpha = .8f), Offset(w * .58f + i * sw, h * .52f), Size(sw + .5f, h * .2f)) }
drawCircle(Color.White.copy(alpha = .06f), w * .2f, Offset(w * .68f, h * .62f))
}
ArcadeBackdrop.MoonBase -> {
drawRect(Brush.verticalGradient(listOf(Color(0xFF02050F), Color(0xFF0B1430))))
starsAt(.3f, 4f)
// The Earth up in the sky, and a little Orbit base on the Moon's grey ground.
drawCircle(Color(0xFF2E6FD8), h * .1f, Offset(w * .8f, h * .2f)); drawCircle(Color(0xFF6EDCAA).copy(alpha = .7f), h * .04f, Offset(w * .78f, h * .18f))
drawCircle(Color(0xFF02050F), h * .1f, Offset(w * .84f, h * .17f))
drawPath(crater, Color(0xFF4A4F60))
drawOval(Color(0xFF3A3E4E), Offset(w * .15f, h * .86f), Size(w * .12f, h * .04f)); drawOval(Color(0xFF3A3E4E), Offset(w * .62f, h * .9f), Size(w * .08f, h * .03f))
drawArc(Color(0xFFDDE4F5), 180f, 180f, true, Offset(w * .36f, h * .7f), Size(w * .14f, h * .16f))
drawRect(Color(0xFFDDE4F5), Offset(w * .5f, h * .74f), Size(w * .1f, h * .05f))
drawLine(Color(0xFFDDE4F5), Offset(w * .55f, h * .74f), Offset(w * .55f, h * .62f), 2f); drawCircle(Color(0xFFFF4FA3), 3f, Offset(w * .55f, h * .62f))
drawCircle(Color(0xFFFFDE59), 3f, Offset(w * .4f, h * .76f)); drawCircle(Color(0xFFFFDE59), 3f, Offset(w * .44f, h * .76f))
}
ArcadeBackdrop.Teletext -> {
drawRect(Color(0xFF02060F))
// A faint mosaic in the teletext colours, on a grid, as if a page were showing through.
@@ -1,6 +1,5 @@
package tv.orbit.classic.arcade.codebreaker
import android.graphics.Bitmap
import android.view.KeyEvent
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.Canvas
@@ -129,7 +128,7 @@ internal fun CodebreakerScreen(play: ArcadePlay) {
// Page 888, drawn into one small bitmap only when something on it changes.
val page = remember { TeletextPage() }
val pixels = remember { IntArray(Teletext.WIDTH * Teletext.HEIGHT) }
val bitmap = remember { Bitmap.createBitmap(Teletext.WIDTH, Teletext.HEIGHT, Bitmap.Config.ARGB_8888) }
val bitmap = remember { androidx.core.graphics.createBitmap(Teletext.WIDTH, Teletext.HEIGHT) }
val image = remember(bitmap) { bitmap.asImageBitmap() }
val doneToday = dailyDone(saved, today)
@@ -61,7 +61,7 @@ internal fun ArcadeDailyScreen(play: ArcadePlay) {
Text(if (done) "Done: today has its star ★" else "Not yet. Whenever you like, or not at all.", color = if (done) ArcadeColours.Yellow else ArcadeColours.Muted, fontSize = 16.sp, fontWeight = FontWeight.SemiBold)
Spacer(Modifier.weight(1f))
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
if (game != null) ArcadeButton("Play ${game.title}", Modifier.width(280.dp).focusRequester(first), icon = "▶", primary = true, height = 36.dp, onClick = { latestPlay.openGame(game.id) })
if (game != null) ArcadeButton("Play ${game.title}", Modifier.width(340.dp).focusRequester(first), icon = "▶", primary = true, height = 36.dp, onClick = { latestPlay.openGame(game.id) })
ArcadeButton("Back to Arcade", Modifier.width(200.dp).then(if (game == null) Modifier.focusRequester(first) else Modifier), icon = "←", height = 36.dp, onClick = { latestPlay.onLeave() })
}
}
@@ -61,7 +61,9 @@ class BackByContextTest {
assertNull(ArcadeBackdrop.parse("SomethingElse"))
val defaults = ArcadeGames.classics.map { ArcadeBackdrop.forGame(it.id) }
assertEquals(8, defaults.size)
// Seven of the eight backdrops are a Classic's own; the eighth (Aurora) is one of Comet Trail's changing skies.
assertEquals(ArcadeBackdrop.entries.toSet(), (defaults + ArcadeBackdrop.cometSkies).toSet())
// Every Classic has its own, and Comet Trail its changing skies, all from the collection.
assertTrue(ArcadeBackdrop.entries.toSet().containsAll(defaults + ArcadeBackdrop.cometSkies))
// The seasonal and channel set are choices for every game (Arcade Settings › Backdrop).
assertEquals(14, ArcadeBackdrop.entries.size)
}
}
@@ -179,4 +179,17 @@ class TitleTextFitsTest {
for (mode in tv.orbit.classic.arcade.quiz.QuizMix.entries) assertTrue(mode.title, width(sans, "◆ ${mode.title}") <= 230 - 2 * 12 - 4)
assertTrue(width(sans, "▶ Who's playing?") <= 230 - 2 * 12 - 4)
}
@Test fun theNewOriginalsWordsFit() {
val sans = Font(Font.SANS_SERIF, Font.BOLD, 1).deriveFont(14f * 1.3f)
// Arcade Daily's Play button names the day's game: every game's title fits it.
for (g in ArcadeGames.all) assertTrue(g.title, width(sans, "▶ Play ${g.title}") <= 340 - 2 * 12 - 4)
assertTrue(340 + 10 + 200 <= 960 - 96 - 24 - 240 - 40)
// Test Card Tangle's and Codebreaker's title buttons and modes.
for (label in listOf("▶ Level 30", "◆ Picture Perfect", "◆ Daily code", "◆ Practice", "▶ Practise instead", "▶ A practice code", "▶ Today's code"))
assertTrue(label, width(sans, label) <= 230 - 2 * 12 - 4)
// The backdrop button's longest name, in an Arcade Settings card (about 330 dp).
val detail = Font(Font.SANS_SERIF, Font.PLAIN, 1).deriveFont(12f * 1.3f)
for (b in tv.orbit.classic.ArcadeBackdrop.entries) assertTrue(b.title, width(sans, "Backdrop") + 8 + width(detail, b.title) <= 330 - 24 - 4)
}
}