0.122.0 (versionCode 313): Orbit Rush, the full game

- Five pilots from the cast library, each with an ability charged by stars (Ollie Patch Up, Blaze
  Speed Burst, Zip Warp Ahead, Drift Slow-mo, Luna Moon Shield), chosen on the title
- Four regions in order with their own art: Asteroid Alley, Broadcast Boulevard, The Static Zone
  (interference bands), The Forbidden Frequency with the 999 portal to a secret route and the wizard
- Star Magnet and Double Stars beside the Orbit Shield; region banners; furthest distance kept
- Gentle: one hazard a row everywhere, a fourth bar of hull, earlier warnings, calmer effects
- Four SoundCraft sounds of its own: boost, slow-mo, portal, region
- Bot dodge checks for every region x difficulty x pilot; 0 bytes allocated; prototype label gone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 13:10:00 +00:00
co-authored by Claude Opus 5.5
parent 86769e500b
commit 3379437cec
25 changed files with 2601 additions and 149 deletions
@@ -7,7 +7,8 @@ import java.io.File
/** The Orbit sound kit: every sound there and small, every list the same length, and the limiter's caps and gaps. */
class SoundKitTest {
private val names = listOf("fire", "hit", "fade", "break", "boss_hit", "boss_down", "player_hit", "shield", "power", "power_end", "level_clear",
"new_best", "game_over", "place", "line", "card", "match", "nope", "turn", "light", "tick", "move", "select", "back", "star", "whoosh", "rise", "dive")
"new_best", "game_over", "place", "line", "card", "match", "nope", "turn", "light", "tick", "move", "select", "back", "star", "whoosh", "rise", "dive",
"rush_boost", "rush_slowmo", "rush_portal", "rush_region")
@Test fun everyListCoversTheWholeKit() {
assertEquals(Sfx.COUNT, names.size)
@@ -90,7 +90,8 @@ class TitleTextFitsTest {
@Test fun theModeButtonSpellsEachModeOutInFull() {
// The mode's whole name on the button, after its ◆, in the title's 210 dp column.
val label = Font(Font.SANS_SERIF, Font.BOLD, 1).deriveFont(14f * 1.3f)
for (mode in listOf("Classic", "Signal Run", "Challenge", "Challenges", "40-Line Sprint", "Daily Challenge", "Daily · Draw Three", "Orbit Deck", "Showtime", "Broadcast", "Wind Down", "Constellations") + tv.orbit.classic.PairsMode.entries.map { it.title }) {
for (mode in listOf("Classic", "Signal Run", "Challenge", "Challenges", "40-Line Sprint", "Daily Challenge", "Daily · Draw Three", "Orbit Deck", "Showtime", "Broadcast", "Wind Down", "Constellations") + tv.orbit.classic.PairsMode.entries.map { it.title } +
tv.orbit.classic.arcade.rush.RPilot.entries.map { "${it.title} · ${it.ability}" }) {
val w = width(label, "◆ $mode")
assertTrue("Mode · $mode is ${"%.0f".format(w)} dp", w <= 230 - 2 * 12 - 4)
}
@@ -121,6 +122,18 @@ class TitleTextFitsTest {
}
}
@Test fun orbitRushsWordsFit() {
// Fly with each pilot on the Play button; the region's banner across the middle of the screen in Anton at 26 sp.
val label = Font(Font.SANS_SERIF, Font.BOLD, 1).deriveFont(14f * 1.3f)
for (p in tv.orbit.classic.arcade.rush.RPilot.entries) assertTrue(width(label, "▶ Fly with ${p.title}") <= 230 - 2 * 12 - 4)
val anton = Font.createFont(Font.TRUETYPE_FONT, File("src/main/res/font/anton_regular.ttf")).deriveFont(26f * 1.3f)
for ((i, n) in tv.orbit.classic.arcade.rush.RRegion.names.withIndex()) assertTrue(n, width(anton, "SECTOR ${i + 1} · ${n.uppercase()}") <= 960 - 64 - 36)
assertTrue(width(anton, "PAGE 999 · THE WIZARD TIPS HIS HAT") <= 960 - 64 - 36)
// The HUD's power line on the right: the longest it says.
val hud = Font(Font.SANS_SERIF, Font.BOLD, 1).deriveFont(15f * 1.3f)
assertTrue(width(hud, "Double Stars on: 8 s") <= 260)
}
@Test fun nightShiftsWordsFit() {
val anton = Font.createFont(Font.TRUETYPE_FONT, File("src/main/res/font/anton_regular.ttf"))
// Each chapter card is a fifth of the row (896 dp less four 10 dp gaps), less 24 dp padding: every word of a name fits a line, at most two lines.
@@ -16,9 +16,9 @@ class RushSimTest {
var nearest = -1
for (i in 0 until RushSim.MAX) if (s.on[i] && s.laneOf[i] == s.lane && s.kind[i] <= RKind.TALL && (nearest < 0 || s.z[i] < s.z[nearest])) nearest = i
if (nearest < 0) return
val seen = (WARN - s.z[nearest]) / s.speed // seconds since its warning came on
val seen = (s.warnAt - s.z[nearest]) / s.worldSpeed // seconds since its warning came on
if (seen < reaction) return
val t = s.z[nearest] / s.speed // seconds until it arrives
val t = s.z[nearest] / s.worldSpeed // seconds until it arrives
when (s.kind[nearest]) {
RKind.ROCK -> {
// The lane whose next hazard is furthest off.
@@ -30,13 +30,13 @@ class RushSimTest {
}
if (best < s.lane) s.left() else if (best > s.lane) s.right()
}
RKind.LOW -> if (t < .45f && s.height != RHeight.RISE) s.rise()
RKind.TALL -> if (t < .45f && s.height != RHeight.DIVE) s.dive()
RKind.LOW -> if (t < .45f && (s.height != RHeight.RISE || s.heightFor < t + .05f)) s.rise() // pressed again if the last rise won't last
RKind.TALL -> if (t < .45f && (s.height != RHeight.DIVE || s.heightFor < t + .05f)) s.dive()
}
}
@Test fun everyHazardCanBeDodgedInTimeOnEveryDifficulty() {
// Three minutes each, at the fastest the run gets: a player reacting within a quarter of a second takes no hits.
// Three minutes each from the start, at the fastest the run gets: a player reacting within a quarter of a second takes no hits.
for (d in Difficulty.entries) for (seed in 1L..6L) {
val s = fresh(d, seed); var hits = 0
repeat(180 * 60) { bot(s, .25f); s.step(); if (s.events and REvents.HIT != 0) hits++ }
@@ -45,6 +45,21 @@ class RushSimTest {
}
}
@Test fun everyRegionCanBeDodgedOnEveryDifficultyWithEveryPilot() {
// Each region from its start for ninety seconds, every pilot using their ability whenever it's ready.
for (d in Difficulty.entries) for (r in 0 until RRegion.names.size) for (p in RPilot.entries) {
val s = RushSim(d); s.newRun(d, 11L + r * 7 + p.ordinal, p); s.distance = RRegion.starts[r] + 1f
var hits = 0; var seen = 0
repeat(90 * 60) {
bot(s, .25f); if (s.ready && s.held == RPower.NONE) s.usePower()
s.step(); if (s.events and REvents.HIT != 0) hits++
if (s.region == r) seen++
}
assertEquals("$d ${RRegion.names[r]} ${p.title}: hits", 0, hits)
assertTrue("$d ${RRegion.names[r]}: stayed in it a while", seen > 20 * 60)
}
}
@Test fun theWarningComesSoonEnoughEvenAtFullSpeed() {
// From the warning to arrival is at least half a second at the top speed on Tricky: time to see and press.
val top = RushSim.MAX_SPEED * 1.18f
@@ -65,12 +80,63 @@ class RushSimTest {
assertEquals(RushSim.HULL, meet(RKind.TALL) { it.dive() }); assertEquals(RushSim.HULL - 1, meet(RKind.TALL) { it.rise() })
}
@Test fun theShieldIsHeldUntilOkAndThenTakesHits() {
@Test fun aPowerUpIsHeldUntilOkAndThenWorks() {
val s = fresh(Difficulty.Normal); for (i in 0 until RushSim.MAX) s.on[i] = false
s.on[0] = true; s.kind[0] = RKind.SHIELD; s.laneOf[0] = 1; s.z[0] = .1f; s.step()
assertTrue(s.shieldHeld); assertTrue(s.usePower()); assertFalse(s.usePower())
s.on[0] = true; s.kind[0] = RKind.POWER; s.power[0] = RPower.SHIELD; s.laneOf[0] = 1; s.z[0] = .1f; s.step()
assertEquals(RPower.SHIELD, s.held); assertTrue(s.usePower()); assertFalse(s.usePower())
s.on[1] = true; s.kind[1] = RKind.ROCK; s.laneOf[1] = 1; s.z[1] = .1f; s.step()
assertEquals(RushSim.HULL, s.hull)
// Star Magnet: stars in other lanes come too. Double Stars: two at a time.
val m = fresh(Difficulty.Normal); for (i in 0 until RushSim.MAX) m.on[i] = false
m.held = RPower.MAGNET; m.usePower(); m.on[0] = true; m.kind[0] = RKind.STAR; m.laneOf[0] = 0; m.z[0] = .1f; m.step()
assertEquals(1, m.stars)
m.held = RPower.DOUBLE; m.usePower(); m.on[0] = true; m.kind[0] = RKind.STAR; m.laneOf[0] = 1; m.z[0] = .1f; m.step()
assertEquals(3, m.stars)
}
@Test fun eachPilotHasTheirOwnAbility() {
fun charged(p: RPilot) = fresh(Difficulty.Normal).also { it.newRun(Difficulty.Normal, 1, p); for (i in 0 until RushSim.MAX) it.on[i] = false; it.charge = 1f }
assertFalse(fresh(Difficulty.Normal).usePower()) // nothing ready: OK does nothing
charged(RPilot.Blaze).let { s -> assertTrue(s.usePower()); assertTrue(s.worldSpeed > s.speed * 1.5f)
s.on[0] = true; s.kind[0] = RKind.ROCK; s.laneOf[0] = 1; s.z[0] = .1f; s.step(); assertEquals(RushSim.HULL, s.hull); assertTrue(s.events and REvents.SMASH != 0) }
charged(RPilot.Drift).let { s -> s.usePower(); assertTrue(s.worldSpeed < s.speed * .6f) }
charged(RPilot.Luna).let { s -> s.usePower(); assertTrue(s.shielded) }
charged(RPilot.Ollie).let { s -> s.hull = 1; s.usePower(); assertEquals(2, s.hull); s.charge = 1f; s.hull = s.hullMax; s.usePower(); assertTrue(s.shielded) }
charged(RPilot.Zip).let { s -> s.on[0] = true; s.kind[0] = RKind.ROCK; s.laneOf[0] = 1; s.z[0] = 30f; val d = s.distance; s.usePower()
assertFalse(s.on[0]); assertTrue(s.distance >= d + 150f) }
// Stars charge it; on its own it fills in [CHARGE_SECONDS].
val s = fresh(Difficulty.Normal); for (i in 0 until RushSim.MAX) s.on[i] = false
s.on[0] = true; s.kind[0] = RKind.STAR; s.laneOf[0] = 1; s.z[0] = .1f; s.step(); assertTrue(s.charge >= RushSim.STAR_CHARGE)
}
@Test fun theRegionsComeInOrderAndThe999PortalOpensTheSecretRoute() {
val s = fresh(Difficulty.Normal, 5); val order = ArrayList<Int>()
repeat(60 * 60 * 6) { bot(s, .2f); s.step(); if (order.lastOrNull() != s.region) order += s.region; if (s.over) return@repeat }
assertEquals(listOf(0, 1, 2, 3), order)
assertTrue("found the portal", s.portals > 0)
// On the secret route: no hazards come, only stars, and the 999 bonus.
val t = fresh(Difficulty.Normal); for (i in 0 until RushSim.MAX) t.on[i] = false
t.distance = RRegion.starts[RRegion.FORBIDDEN] + 1f
t.on[0] = true; t.kind[0] = RKind.PORTAL; t.laneOf[0] = 1; t.z[0] = .1f; t.step()
assertTrue(t.secretFor > 0f); assertTrue(t.events and REvents.PORTAL != 0); assertEquals(999, t.bonus)
var hazards = 0; var stars = 0
repeat((RushSim.SECRET_TIME * 60).toInt() - 30) { t.step(); for (i in 0 until RushSim.MAX) if (t.on[i]) { if (t.kind[i] <= RKind.TALL) hazards++ else if (t.kind[i] == RKind.STAR) stars++ } }
assertEquals(0, hazards); assertTrue(stars > 0)
}
@Test fun gentleIsGentler() {
val g = fresh(Difficulty.Gentle); val n = fresh(Difficulty.Normal)
assertEquals(RushSim.HULL + 1, g.hullMax); assertEquals(RushSim.HULL, n.hullMax)
assertTrue(g.warnAt > n.warnAt)
// One hazard a row everywhere, even in The Static Zone.
g.distance = RRegion.starts[RRegion.STATIC] + 1f
repeat(60 * 60) {
g.step()
for (i in 0 until RushSim.MAX) if (g.on[i] && g.kind[i] <= RKind.TALL && g.z[i] > FAR - 1f) {
val same = (0 until RushSim.MAX).count { j -> g.on[j] && g.kind[j] <= RKind.TALL && kotlin.math.abs(g.z[j] - g.z[i]) < .01f }
assertEquals(1, same)
}
}
}
@Test fun threeHitsEndTheRunAndTheStormClosesIn() {
@@ -84,9 +150,14 @@ class RushSimTest {
repeat(2_000) { bot(s, .25f); s.step() }
val mx = java.lang.management.ManagementFactory.getThreadMXBean() as com.sun.management.ThreadMXBean
val before = mx.getThreadAllocatedBytes(Thread.currentThread().id)
repeat(10_000) { bot(s, .25f); s.step(); if (s.over) s.newRun(Difficulty.Normal, 4) }
var n = 0
while (n < 20_000) {
bot(s, .25f); if (s.ready || s.held != RPower.NONE) s.usePower()
if (n == 5_000) s.distance = RRegion.starts[RRegion.FORBIDDEN]
s.step(); if (s.over) s.newRun(Difficulty.Normal, 4, RPilot.entries[n % 5]); n++
}
val bytes = mx.getThreadAllocatedBytes(Thread.currentThread().id) - before
println("Orbit Rush: 10,000 ticks allocated $bytes bytes")
println("Orbit Rush: 20,000 ticks allocated $bytes bytes")
assertTrue("allocated $bytes", bytes < 8 * 1024)
}