diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 041e6400..6d227fb5 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -9,8 +9,8 @@ android { applicationId = "tv.orbit.classic" minSdk = 26 targetSdk = 36 - versionCode = 312 - versionName = "0.121.0-house-scores" + versionCode = 313 + versionName = "0.122.0-orbit-rush" } buildFeatures { compose = true } // The finished build for the TVs (Paul, 6 November 2026: the test build stuttered on the box). Not debuggable, so diff --git a/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeGames.kt b/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeGames.kt index 69725e2a..856c8adf 100644 --- a/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeGames.kt +++ b/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeGames.kt @@ -122,11 +122,11 @@ internal object ArcadeGames { tv.orbit.classic.arcade.daily.ArcadeDailyScreen(it) } - // Paul's idea, 9 November 2026: a prototype to try for feel, plain shapes first. - val OrbitRush: ArcadeGame = GameDef("OrbitRush", "Orbit Rush", "Outrun the static storm", "Blaze races down three lanes through Asteroid Alley, a static storm behind.", Mascot.Blaze, + // Paul's idea, 9 November 2026: the prototype for feel first, then the full game (pilots, regions, the 999 portal). + val OrbitRush: ArcadeGame = GameDef("OrbitRush", "Orbit Rush", "Outrun the static storm", "Fly through the Orbit universe, three lanes, a static storm behind.", Mascot.Blaze, kidsSuitable = true, original = true, launchable = true, ScoreKind.Points, keepsLevels = false, legacyRecordKey = null, - listOf(Control("◀▶", "Change lane"), Control("▲", "Rise over"), Control("▼", "Dive under"), Control("OK", "Use the power-up"), BackPause), - "Red lane: change lanes. Yellow: rise. Cyan: dive.", listOf(GameSetting("sounds", "Sound effects"))) { + listOf(Control("◀▶", "Change lane"), Control("▲", "Rise over"), Control("▼", "Dive under"), Control("OK", "Power-up, or your pilot's ability"), BackPause), + "Red lane: change lanes. Yellow: rise. Cyan: dive. Choose your pilot on the title.", listOf(GameSetting("sounds", "Sound effects"))) { tv.orbit.classic.arcade.rush.OrbitRushScreen(it) } diff --git a/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeSfx.kt b/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeSfx.kt index 35ad9e40..d0978e95 100644 --- a/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeSfx.kt +++ b/android/app/src/main/java/tv/orbit/classic/arcade/ArcadeSfx.kt @@ -16,7 +16,9 @@ internal object Sfx { const val NEW_BEST = 11; const val GAME_OVER = 12; const val PLACE = 13; const val LINE = 14; const val CARD = 15; const val MATCH = 16 const val NOPE = 17; const val TURN = 18; const val LIGHT = 19; const val TICK = 20; const val MOVE = 21; const val SELECT = 22 const val BACK = 23; const val STAR = 24; const val WHOOSH = 25; const val RISE = 26; const val DIVE = 27 - const val COUNT = 28 + /** Orbit Rush's own. */ + const val BOOST = 28; const val SLOWMO = 29; const val PORTAL = 30; const val REGION = 31 + const val COUNT = 32 /** The most of one sound at once, over the whole kit. */ const val MAX_AT_ONCE = 3 @@ -24,20 +26,21 @@ internal object Sfx { R.raw.sfx_player_hit, R.raw.sfx_shield, R.raw.sfx_power, R.raw.sfx_power_end, R.raw.sfx_level_clear, R.raw.sfx_new_best, R.raw.sfx_game_over, R.raw.sfx_place, R.raw.sfx_line, R.raw.sfx_card, R.raw.sfx_match, R.raw.sfx_nope, R.raw.sfx_turn, R.raw.sfx_light, R.raw.sfx_tick, R.raw.sfx_move, R.raw.sfx_select, - R.raw.sfx_back, R.raw.sfx_star, R.raw.sfx_whoosh, R.raw.sfx_rise, R.raw.sfx_dive) + R.raw.sfx_back, R.raw.sfx_star, R.raw.sfx_whoosh, R.raw.sfx_rise, R.raw.sfx_dive, + R.raw.sfx_rush_boost, R.raw.sfx_rush_slowmo, R.raw.sfx_rush_portal, R.raw.sfx_rush_region) /** Each sound's level before the profile's settings and Orbit's quiet ceiling. The files are already mixed; these sit them together. */ val level = floatArrayOf(.55f, .6f, .6f, .65f, .7f, .75f, .7f, .65f, .7f, .6f, .75f, .75f, .65f, .6f, .7f, .55f, .7f, - .6f, .55f, .6f, .5f, .45f, .55f, .5f, .6f, .55f, .55f, .55f) + .6f, .55f, .6f, .5f, .45f, .55f, .5f, .6f, .55f, .55f, .55f, .65f, .6f, .7f, .7f) /** How many of each may sound at once (never more than [MAX_AT_ONCE]). */ - val atOnce = intArrayOf(3, 3, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 3, 2, 1, 1) + val atOnce = intArrayOf(3, 3, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1) /** The shortest gap between two of one sound, in milliseconds: a held fire button or a burst of hits stays a patter, not a buzz. */ - val gapMs = intArrayOf(70, 45, 60, 50, 90, 400, 250, 200, 150, 150, 500, 500, 500, 40, 120, 35, 120, 150, 35, 50, 60, 30, 60, 60, 40, 80, 90, 90) + val gapMs = intArrayOf(70, 45, 60, 50, 90, 400, 250, 200, 150, 150, 500, 500, 500, 40, 120, 35, 120, 150, 35, 50, 60, 30, 60, 60, 40, 80, 90, 90, 400, 400, 800, 800) /** The big moments stay heard when the pool is full: a shot gives way first. */ - val priority = intArrayOf(0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 2, 2, 2, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0) + val priority = intArrayOf(0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 2, 2, 2, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 2) } /** diff --git a/android/app/src/main/java/tv/orbit/classic/arcade/rush/OrbitRushScreen.kt b/android/app/src/main/java/tv/orbit/classic/arcade/rush/OrbitRushScreen.kt index cb1db2a9..45a4c3b9 100644 --- a/android/app/src/main/java/tv/orbit/classic/arcade/rush/OrbitRushScreen.kt +++ b/android/app/src/main/java/tv/orbit/classic/arcade/rush/OrbitRushScreen.kt @@ -1,6 +1,5 @@ package tv.orbit.classic.arcade.rush -import tv.orbit.classic.arcade.Sfx import android.view.KeyEvent import androidx.activity.compose.BackHandler import androidx.compose.foundation.Canvas @@ -14,23 +13,36 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawWithCache import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.drawscope.CanvasDrawScope import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.drawscope.scale +import androidx.compose.ui.graphics.drawscope.translate import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.drawText import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.rememberTextMeasurer +import androidx.compose.ui.unit.Density +import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.IntSize +import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.tv.material3.Text import tv.orbit.classic.Anton +import tv.orbit.classic.ArcadeBackdrop import tv.orbit.classic.Motion +import tv.orbit.classic.OrbCharacter +import tv.orbit.classic.OrbDir import tv.orbit.classic.arcade.ArcadeColours import tv.orbit.classic.arcade.ArcadeGameLoop import tv.orbit.classic.arcade.ArcadeGames @@ -40,40 +52,135 @@ import tv.orbit.classic.arcade.ArcadePlay import tv.orbit.classic.arcade.ClassicResult import tv.orbit.classic.arcade.ClassicTitle import tv.orbit.classic.arcade.Control +import tv.orbit.classic.arcade.Difficulty import tv.orbit.classic.arcade.HowToPlayCard import tv.orbit.classic.arcade.KeyFooter import tv.orbit.classic.arcade.Mascot import tv.orbit.classic.arcade.PauseWhenHidden import tv.orbit.classic.arcade.RunEnd import tv.orbit.classic.arcade.RunTracker +import tv.orbit.classic.arcade.Sfx import tv.orbit.classic.arcade.gameKeys -import tv.orbit.classic.arcade.orbiteroids.OrbiteroidsArt import tv.orbit.classic.arcade.previousLine import tv.orbit.classic.arcade.raiders.FixedStep -import tv.orbit.classic.arcade.raiders.Pilot -import tv.orbit.classic.arcade.raiders.pilotFace -import tv.orbit.classic.ArcadeBackdrop -import tv.orbit.classic.starPath +import tv.orbit.classic.arcade.raiders.StoryArt +import tv.orbit.classic.drawOrbChaser +import tv.orbit.classic.drawOrbMascot -/** Orbit Rush's colours: plain shapes first (the prototype), each hazard its own colour and shape, unlike Orbiteroids'. */ +/** + * Orbit Rush's look. The warnings never change colour from region to region (red, change lane; yellow, rise; cyan, dive), + * so the moves stay readable; everything else takes its region's colours. + */ internal object RColours { - val Rock = Color(0xFFC2662D); val RockDark = Color(0xFF7A3A16) - val Low = Color(0xFF3F6FD8); val Panel = Color(0xFF9EC1FF) - val Tall = Color(0xFFE040A0) val Star = Color(0xFFFFDE59) val Shield = Color(0xFF22C3D8) - val Track = Color(0xFF16245A); val Edge = Color(0xFF3D63B8) + val Magnet = Color(0xFFFF6B9A) + val Double = Color(0xFFFFB13D) + val Portal = Color(0xFFB57CFF) /** The warning on a lane before each hazard: red means change lane, yellow means rise, cyan means dive. */ fun warn(kind: Int) = when (kind) { RKind.ROCK -> Color(0xFFFF6B6B); RKind.LOW -> Color(0xFFFFDE59); else -> Color(0xFF35D6F2) } + fun power(p: Int) = when (p) { RPower.SHIELD -> Shield; RPower.MAGNET -> Magnet; else -> Double } } +/** One region's colours: its sky, its track, and its three hazards (each still lit by its warning colour). */ +internal class RegionLook(val skyTop: Color, val skyLow: Color, val ground: Color, val track: Color, val edge: Color, + val block: Color, val blockDark: Color, val low: Color, val lowLight: Color, val tall: Color) + +internal val RegionLooks = arrayOf( + // Asteroid Alley: deep blue, brown tumbling rocks. + RegionLook(Color(0xFF040A1E), Color(0xFF0E1A48), Color(0xFF060C24), Color(0xFF16245A), Color(0xFF3D63B8), + Color(0xFFC2662D), Color(0xFF7A3A16), Color(0xFF3F6FD8), Color(0xFF9EC1FF), Color(0xFFE040A0)), + // Broadcast Boulevard: teal night, broken TV screens, satellite arrays, signal gates. + RegionLook(Color(0xFF031A22), Color(0xFF0B3A4A), Color(0xFF041419), Color(0xFF0E3340), Color(0xFF2FA5B8), + Color(0xFF2A2F45), Color(0xFF151827), Color(0xFF8D95AE), Color(0xFFE6EEFF), Color(0xFFFF8A3D)), + // The Static Zone: grey-violet, rogue pixels and interference. + RegionLook(Color(0xFF14121E), Color(0xFF2B2740), Color(0xFF0D0B16), Color(0xFF26223A), Color(0xFF8D86B8), + Color(0xFF6CE0A0), Color(0xFF2F7A55), Color(0xFFB9B4D6), Color(0xFFFFFFFF), Color(0xFFFF4FA3)), + // The Forbidden Frequency: deep purple, dark crystals, the 999 portal. + RegionLook(Color(0xFF12041F), Color(0xFF2E0B4A), Color(0xFF0A0214), Color(0xFF240A3D), Color(0xFFB57CFF), + Color(0xFF6A3DC7), Color(0xFF2C1460), Color(0xFF8F5BE0), Color(0xFFE2CCFF), Color(0xFF35D6F2)), +) + +/** The secret route behind the 999 portal: Orbi-Fax's teletext colours. */ +private val SecretLook = RegionLook(Color(0xFF000000), Color(0xFF00005A), Color(0xFF000014), Color(0xFF0000AA), Color(0xFFFFFF00), + Color.Black, Color.Black, Color.Black, Color.Black, Color.Black) + private enum class RStage { Title, Play, Result } /** HUD numbers, read once a frame; Compose redraws only what changed. */ private class RHud { - var score by mutableIntStateOf(0); var hull by mutableIntStateOf(RushSim.HULL); var stars by mutableIntStateOf(0) - var shieldHeld by mutableStateOf(false); var shieldSecs by mutableIntStateOf(0); var frame by mutableIntStateOf(0) - fun read(s: RushSim) { score = s.score; hull = s.hull; stars = s.stars; shieldHeld = s.shieldHeld; shieldSecs = kotlin.math.ceil(s.shieldFor).toInt(); frame++ } + var score by mutableIntStateOf(0); var hull by mutableIntStateOf(RushSim.HULL); var hullMax by mutableIntStateOf(RushSim.HULL); var stars by mutableIntStateOf(0) + var held by mutableIntStateOf(RPower.NONE); var active by mutableIntStateOf(RPower.NONE); var activeSecs by mutableIntStateOf(0) + var charge by mutableIntStateOf(0); var metres by mutableIntStateOf(0); var region by mutableIntStateOf(0); var secret by mutableStateOf(false) + var frame by mutableIntStateOf(0) + fun read(s: RushSim) { + score = s.score; hull = s.hull; hullMax = s.hullMax; stars = s.stars; held = s.held; active = if (s.activeFor > 0f) s.active else RPower.NONE + activeSecs = kotlin.math.ceil(s.activeFor).toInt(); charge = (s.charge * 10).toInt(); metres = s.distance.toInt() / 10 * 10; region = s.region + secret = s.secretFor > 0f; frame++ + } +} + +/** The cast's faces, drawn once into bitmaps from the cast library. Only Ollie has a mouth, as everywhere in Orbit. */ +internal fun rushFace(p: RPilot, px: Int, density: Density): ImageBitmap { + val image = ImageBitmap(px, px) + CanvasDrawScope().draw(density, LayoutDirection.Ltr, androidx.compose.ui.graphics.Canvas(image), Size(px.toFloat(), px.toFloat())) { + val c = Offset(px / 2f, px / 2f); val r = px * .33f + when (p) { + RPilot.Ollie -> drawOrbMascot(c, r, OrbDir.Up) + RPilot.Blaze -> drawOrbChaser(c, r * 1.1f, OrbCharacter.Blaze, OrbDir.Up, false, false, false, 0f) + RPilot.Zip -> drawOrbChaser(c, r * 1.1f, OrbCharacter.Zip, OrbDir.Up, false, false, false, 0f) + RPilot.Drift -> drawOrbChaser(c, r * 1.1f, OrbCharacter.Drift, OrbDir.Up, false, false, false, 0f) + RPilot.Luna -> drawOrbChaser(c, r * 1.1f, OrbCharacter.Luna, OrbDir.Up, false, false, false, 0f) + } + } + return image +} + +/** Each pilot's colour: the rocket's fins and the ability's glow. Ollie's is Orbit's yellow. */ +internal fun pilotColour(p: RPilot) = when (p) { + RPilot.Ollie -> Color(0xFFFFD23F); RPilot.Blaze -> OrbCharacter.Blaze.colour; RPilot.Zip -> OrbCharacter.Zip.colour + RPilot.Drift -> OrbCharacter.Drift.colour; RPilot.Luna -> OrbCharacter.Luna.colour +} + +/** Everything drawn that's made once: the rocket's shapes, the faces, the 999 sign, reused every frame. */ +internal class RushArt(val faces: Array, val portalSign: androidx.compose.ui.text.TextLayoutResult) { + val body = Path().apply { moveTo(0f, -16f); cubicTo(7f, -10f, 7f, 4f, 5f, 10f); lineTo(-5f, 10f); cubicTo(-7f, 4f, -7f, -10f, 0f, -16f); close() } + val nose = Path().apply { moveTo(0f, -16f); cubicTo(3.6f, -13f, 5f, -11f, 5.6f, -9f); lineTo(-5.6f, -9f); cubicTo(-5f, -11f, -3.6f, -13f, 0f, -16f); close() } + val finL = Path().apply { moveTo(-5f, 0f); lineTo(-13f, 8f); lineTo(-13f, 11f); lineTo(-5f, 8f); close() } + val finR = Path().apply { moveTo(5f, 0f); lineTo(13f, 8f); lineTo(13f, 11f); lineTo(5f, 8f); close() } + val flame = Path().apply { moveTo(-3f, 10f); quadraticTo(0f, 22f, 3f, 10f); close() } + val bigFlame = Path().apply { moveTo(-4f, 10f); quadraticTo(0f, 32f, 4f, 10f); close() } + val faceSize = IntSize(faces[0].width, faces[0].height) + /** Shapes rebuilt in place each frame (drawing runs on the one UI thread): the up/down marker, a star, a crystal. */ + val marker = Path() + val star = Path() + val crystal = Path() + + fun DrawScope.rocket(x: Float, y: Float, s: RushSim, flicker: Float) { + val fin = pilotColour(s.pilot) + translate(x, y) { + scale(1.2f, 1.2f, Offset.Zero) { + drawPath(if (s.burstFor > 0f) bigFlame else flame, Color(0xFFFF9A3D), alpha = .8f + .2f * flicker) + drawPath(finL, fin); drawPath(finR, fin) + drawPath(body, if (s.hurtFor > 0f) Color(0xFFFFB3B3) else Color(0xFFEFF3FF)) + drawPath(nose, fin) + drawCircle(Color(0xFF1B2A4E), 4.8f, Offset(0f, -3f)) + drawImage(faces[s.pilot.ordinal], IntOffset.Zero, faceSize, IntOffset(-4, -7), IntSize(8, 8)) + } + } + } + + /** A star pickup, [r] across. */ + fun DrawScope.starAt(c: Offset, r: Float) { + star.reset() + for (k in 0 until 10) { + val a = -Math.PI / 2 + k * Math.PI / 5; val rad = if (k % 2 == 0) r else r * .45f + val px = c.x + (rad * kotlin.math.cos(a)).toFloat(); val py = c.y + (rad * kotlin.math.sin(a)).toFloat() + if (k == 0) star.moveTo(px, py) else star.lineTo(px, py) + } + star.close() + drawPath(star, RColours.Star) + } } @Composable @@ -83,7 +190,12 @@ internal fun OrbitRushScreen(play: ArcadePlay) { val calm = Motion.reduce val steady = calm || play.reduceFlashing val density = LocalDensity.current - val art = remember(density) { OrbiteroidsArt(pilotFace(Pilot.Blaze, 96, density)) } + val measurer = rememberTextMeasurer() + val art = remember(density) { + RushArt(RPilot.entries.map { rushFace(it, 96, density) }.toTypedArray(), + measurer.measure("999", TextStyle(color = Color(0xFFFFFF00), fontSize = 22.sp, fontWeight = FontWeight.Bold))) + } + val story = remember(density) { StoryArt(density, measurer) } val sim = remember { RushSim(play.difficulty) } val hud = remember { RHud() } val stepper = remember { FixedStep() } @@ -92,11 +204,23 @@ internal fun OrbitRushScreen(play: ArcadePlay) { var howTo by remember { mutableStateOf(false) } var soundsOn by remember { mutableStateOf(play.setting("sounds")) } var bestBefore by remember { mutableIntStateOf(play.best) } + var pilot by remember { mutableStateOf(RPilot.entries.firstOrNull { it.name == play.level["pilot"] } ?: RPilot.Blaze) } + var farthest by remember { mutableIntStateOf(play.level["farthest"]?.toIntOrNull() ?: 0) } + /** The region's name across the screen as it's entered, for a moment. */ + var banner by remember { mutableStateOf(null) } + var bannerAt by remember { mutableLongStateOf(0L) } val tracker = remember { RunTracker { end -> latestPlay.onRunEnd(end) } } - fun endRun(finished: Boolean) { tracker.end(RunEnd(sim.score, finished, "${sim.distance.toInt()} m")) } + fun endRun(finished: Boolean) { + if (sim.distance.toInt() > farthest && tracker.open) { farthest = sim.distance.toInt(); latestPlay.setLevel("farthest", farthest.toString()) } + tracker.end(RunEnd(sim.score, finished, "${sim.pilot.title} · ${sim.distance.toInt()} m · ${RRegion.names[sim.region]}")) + } DisposableEffect(Unit) { onDispose { endRun(false) } } - fun startRun() { bestBefore = maxOf(latestPlay.best, bestBefore); sim.newRun(latestPlay.difficulty, System.nanoTime()); stepper.reset(); hud.read(sim); tracker.begin(); paused = false; stage = RStage.Play } - fun pause() { if (stage == RStage.Play && !paused) { paused = true; stepper.reset() } } + fun startRun() { + bestBefore = maxOf(latestPlay.best, bestBefore) + sim.newRun(latestPlay.difficulty, System.nanoTime(), pilot); stepper.reset(); hud.read(sim); tracker.begin(); paused = false + banner = "SECTOR 1 · ${RRegion.names[0].uppercase()}"; bannerAt = System.currentTimeMillis(); stage = RStage.Play + } + fun pause() { if (stage == RStage.Play && !paused) { paused = true; stepper.reset(); latestPlay.audio.pauseAll() } } fun leave() { endRun(sim.over); latestPlay.onLeave() } PauseWhenHidden(stage == RStage.Play && !paused) { pause() } ArcadeGameLoop(running = stage == RStage.Play && !paused) { _, dt -> @@ -104,27 +228,45 @@ internal fun OrbitRushScreen(play: ArcadePlay) { var ev = 0 for (i in 0 until n) { sim.step(); ev = ev or sim.events } if (ev != 0) { - // The Orbit sound kit: a ping for a star, a soft bonk for a knock, the shield's shimmer. + // The Orbit sound kit, with Orbit Rush's own for the abilities, the portal and each new region. val audio = latestPlay.audio if (ev and REvents.STAR != 0) audio.sfx(Sfx.STAR, soundsOn) + if (ev and REvents.SMASH != 0) audio.sfx(Sfx.BREAK, soundsOn) if (ev and REvents.HIT != 0 && ev and REvents.OVER == 0) audio.sfx(Sfx.PLAYER_HIT, soundsOn) if (ev and REvents.POWER != 0) audio.sfx(Sfx.POWER, soundsOn) - if (ev and REvents.SHIELD_ON != 0) audio.sfx(Sfx.SHIELD, soundsOn) + if (ev and REvents.POWER_ON != 0) audio.sfx(if (sim.active == RPower.SHIELD) Sfx.SHIELD else Sfx.LIGHT, soundsOn) + if (ev and REvents.CHARGED != 0) audio.sfx(Sfx.SELECT, soundsOn) + if (ev and REvents.ABILITY != 0) audio.sfx(when (sim.pilot) { + RPilot.Blaze -> Sfx.BOOST; RPilot.Drift -> Sfx.SLOWMO; RPilot.Zip -> Sfx.WHOOSH; RPilot.Luna -> Sfx.SHIELD; RPilot.Ollie -> Sfx.POWER + }, soundsOn) + if (ev and REvents.PORTAL != 0) { audio.sfx(Sfx.PORTAL, soundsOn); banner = "PAGE 999 · THE WIZARD TIPS HIS HAT"; bannerAt = System.currentTimeMillis() } + if (ev and REvents.REGION != 0) { + audio.sfx(Sfx.REGION, soundsOn) + banner = "SECTOR ${sim.region + 1} · ${RRegion.names[sim.region].uppercase()}"; bannerAt = System.currentTimeMillis() + } if (ev and REvents.OVER != 0) audio.sfx(if (sim.score > bestBefore) Sfx.NEW_BEST else Sfx.GAME_OVER, soundsOn) } hud.read(sim) if (sim.over) { endRun(true); stage = RStage.Result } } + LaunchedEffect(bannerAt) { if (banner != null) { kotlinx.coroutines.delay(2_600); banner = null } } val focus = remember { FocusRequester() } LaunchedEffect(stage, paused) { if (stage == RStage.Play && !paused) runCatching { focus.requestFocus() } } BackHandler(stage == RStage.Play && !paused) { pause() } if (stage == RStage.Title) { - ClassicTitle(gameDef, ArcadeBackdrop.DeepSpace, tv.orbit.classic.OrbCharacter.Blaze.colour, "The storm's behind us. Go!", - listOf("Your best" to if (play.best > 0) "%,d".format(play.best) else "Not played yet"), timed = true, difficulty = play.difficulty, - refocus = !howTo, onPlay = ::startRun, onHowTo = { howTo = true }, onBack = { latestPlay.onLeave() }, kicker = "AN ORBIT ARCADE ORIGINAL · PROTOTYPE", - mode = "Asteroid Alley", - note = "Blaze flies on his own. ◀▶ change lane round a rock, ▲ rises over a low satellite, ▼ dives under a tall signal gate. Each lane lights up before something arrives: red, change lane; yellow, rise; cyan, dive. Grab a shield and OK puts it on.") + ClassicTitle(gameDef, ArcadeBackdrop.DeepSpace, pilotColour(pilot), "The storm's behind us. Go!", + listOf("Your best" to if (play.best > 0) "%,d".format(play.best) else "Not played yet", + "Furthest" to if (farthest > 0) "%,d m".format(farthest) else "—"), + timed = true, difficulty = play.difficulty, + refocus = !howTo, onPlay = ::startRun, onHowTo = { howTo = true }, onBack = { latestPlay.onLeave() }, kicker = "AN ORBIT ARCADE ORIGINAL", + mode = "${pilot.title} · ${pilot.ability}", modes = RPilot.entries.size, + onMode = { pilot = RPilot.entries[(pilot.ordinal + 1) % RPilot.entries.size]; latestPlay.setLevel("pilot", pilot.name) }, + playLabel = "Fly with ${pilot.title}", + note = "${pilot.title}'s ability, ${pilot.ability}: ${pilot.line}. Stars charge it; OK sets it off when no power-up is held. " + + "◀▶ change lane round anything solid, ▲ rises over a low thing, ▼ dives under a tall one: each lane lights up first, red, yellow or cyan. " + + "Fly on from Asteroid Alley to Broadcast Boulevard, The Static Zone and The Forbidden Frequency" + + if (play.difficulty == Difficulty.Gentle) ". Gentle: slower, one hazard at a time, an extra bar of hull and earlier warnings." else ".") if (howTo) HowToPlayCard(gameDef, firstRun = false, everyTime = null, onEveryTime = {}, onPlay = { howTo = false }, onBack = { howTo = false }) return } @@ -137,54 +279,80 @@ internal fun OrbitRushScreen(play: ArcadePlay) { ArcadeKey.Right -> { val was = sim.lane; sim.right(); if (sim.lane != was) latestPlay.audio.sfx(Sfx.WHOOSH, soundsOn) } ArcadeKey.Up -> if (native.repeatCount == 0 && !sim.over) { sim.rise(); latestPlay.audio.sfx(Sfx.RISE, soundsOn) } ArcadeKey.Down -> if (native.repeatCount == 0 && !sim.over) { sim.dive(); latestPlay.audio.sfx(Sfx.DIVE, soundsOn) } - ArcadeKey.Ok -> if (native.repeatCount == 0) sim.usePower() + ArcadeKey.Ok -> if (native.repeatCount == 0 && !sim.usePower()) latestPlay.audio.sfx(Sfx.NOPE, soundsOn) else -> return@gameKeys false } true } + val gentle = play.difficulty == Difficulty.Gentle Box(Modifier.fillMaxSize().then(keys)) { - Box(Modifier.fillMaxSize().rushSky()) - Canvas(Modifier.fillMaxSize()) { hud.frame; drawRush(art, sim, calm, steady) } + Box(Modifier.fillMaxSize().rushSky(if (hud.secret) SecretLook else RegionLooks[hud.region])) + Canvas(Modifier.fillMaxSize()) { + hud.frame + drawRush(art, sim, calm, steady, gentle) + if (sim.secretFor > 0f) with(story) { wizard(size.width * .78f, size.height * .3f, size.height * .26f, if (calm) 1f else minOf(1f, (RushSim.SECRET_TIME - sim.secretFor) / 1.2f), tinted = false) } + } Column(Modifier.fillMaxSize().padding(start = 32.dp, end = 32.dp, top = 20.dp, bottom = 10.dp)) { Row(Modifier.fillMaxWidth()) { Column(Modifier.weight(1f)) { Text("SCORE", color = ArcadeColours.Muted, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp) Text("%,d".format(hud.score), color = ArcadeColours.Ink, fontFamily = Anton, fontSize = 30.sp) - Text("★ ${hud.stars}", color = RColours.Star, fontSize = 16.sp, fontWeight = FontWeight.SemiBold) + Text("★ ${hud.stars} · %,d m".format(hud.metres), color = RColours.Star, fontSize = 16.sp, fontWeight = FontWeight.SemiBold) + Text(if (hud.secret) "Page 999 · the secret route" else RRegion.names[hud.region], color = ArcadeColours.Muted, fontSize = 14.sp) } Column(horizontalAlignment = Alignment.End) { Text("HULL", color = ArcadeColours.Muted, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp) - Row(horizontalArrangement = Arrangement.spacedBy(3.dp)) { for (i in 0 until RushSim.HULL) Box(Modifier.size(28.dp, 10.dp).background(if (i < hud.hull) Color(0xFF4CD98A) else Color(0xFF1C2A5A), RoundedCornerShape(3.dp))) } + Row(horizontalArrangement = Arrangement.spacedBy(3.dp)) { for (i in 0 until hud.hullMax) Box(Modifier.size(28.dp, 10.dp).background(if (i < hud.hull) Color(0xFF4CD98A) else Color(0xFF1C2A5A), RoundedCornerShape(3.dp))) } Spacer(Modifier.height(6.dp)) - Text(when { hud.shieldSecs > 0 -> "Orbit Shield on: ${hud.shieldSecs} s"; hud.shieldHeld -> "OK: Orbit Shield"; else -> "No power-up" }, - color = if (hud.shieldHeld || hud.shieldSecs > 0) RColours.Shield else ArcadeColours.Muted, fontSize = 15.sp, fontWeight = FontWeight.SemiBold) + Text(when { + hud.activeSecs > 0 && hud.active != RPower.NONE -> "${RPower.titles[hud.active]} on: ${hud.activeSecs} s" + hud.held != RPower.NONE -> "OK: ${RPower.titles[hud.held]}" + hud.charge >= 10 -> "OK: ${sim.pilot.ability}" + else -> "No power-up" + }, color = when { + hud.active != RPower.NONE && hud.activeSecs > 0 -> RColours.power(hud.active) + hud.held != RPower.NONE -> RColours.power(hud.held) + hud.charge >= 10 -> pilotColour(sim.pilot) + else -> ArcadeColours.Muted + }, fontSize = 15.sp, fontWeight = FontWeight.SemiBold) + // The ability's charge: ten pips in the pilot's colour. + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(2.dp)) { + Text("${sim.pilot.ability} ", color = ArcadeColours.Muted, fontSize = 13.sp) + for (i in 0 until 10) Box(Modifier.size(7.dp, 9.dp).background(if (i < hud.charge) pilotColour(sim.pilot) else Color(0xFF1C2A5A), RoundedCornerShape(2.dp))) + } } } Spacer(Modifier.weight(1f)) - KeyFooter(listOf(Control("◀▶", "Lane"), Control("▲", "Rise"), Control("▼", "Dive"), Control("OK", "Power-up"), Control("Back", "Pause")), note = "Asteroid Alley · prototype") + banner?.let { Text(it, Modifier.align(Alignment.CenterHorizontally).background(Color(0xCC0A1030), RoundedCornerShape(10.dp)).padding(horizontal = 18.dp, vertical = 6.dp), + color = ArcadeColours.Ink, fontFamily = Anton, fontSize = 26.sp) } + Spacer(Modifier.weight(1f)) + KeyFooter(listOf(Control("◀▶", "Lane"), Control("▲", "Rise"), Control("▼", "Dive"), Control("OK", "Power-up or ability"), Control("Back", "Pause")), + note = "${sim.pilot.title} · ${RRegion.names[hud.region]}") } - if (stage == RStage.Result) ClassicResult(gameDef, "ORBIT RUSH · ${sim.distance.toInt()} M THROUGH ASTEROID ALLEY", "SCORE", "%,d".format(sim.score), + if (stage == RStage.Result) ClassicResult(gameDef, "ORBIT RUSH · ${sim.distance.toInt()} M · ${RRegion.names[sim.region].uppercase()}", "SCORE", "%,d".format(sim.score), newBest = sim.score > bestBefore && sim.score > 0, previous = previousLine(gameDef.scoreKind, bestBefore, gameDef.title), - detail = "${sim.stars} stars · ${sim.dodged} dodged · the static storm caught up", cheer = Mascot.Zip, onAgain = { endRun(sim.over); startRun() }, onBack = ::leave) - if (paused && stage == RStage.Play) ArcadePauseMenu(gameDef, "Orbit Rush · ${sim.distance.toInt()} m · ${"%,d".format(sim.score)}", - onResume = { paused = false; stepper.reset() }, onRestart = { endRun(false); startRun() }, onExit = ::leave, + detail = "${sim.pilot.title} · ${sim.stars} stars · ${sim.dodged} dodged" + (if (sim.portals > 0) " · through the 999 portal" else "") + " · the static storm caught up", + cheer = when (sim.pilot) { RPilot.Ollie -> Mascot.Ollie; RPilot.Blaze -> Mascot.Blaze; RPilot.Zip -> Mascot.Zip; RPilot.Drift -> Mascot.Drift; RPilot.Luna -> Mascot.Luna }, + onAgain = { endRun(sim.over); startRun() }, onBack = ::leave) + if (paused && stage == RStage.Play) ArcadePauseMenu(gameDef, "Orbit Rush · ${sim.pilot.title} · ${sim.distance.toInt()} m · ${"%,d".format(sim.score)}", + onResume = { paused = false; stepper.reset(); latestPlay.audio.resumeAll() }, onRestart = { endRun(false); startRun() }, onExit = ::leave, sound = if (soundsOn) "Effects on" else "Effects off", onSound = { soundsOn = !soundsOn; latestPlay.setSetting("sounds", soundsOn) }) } } -/** The sky and the track's lanes, drawn once in their own layer: only what moves is drawn each frame. */ -private fun Modifier.rushSky(): Modifier = graphicsLayer().drawWithCache { +/** The sky and the track's lanes in the region's colours, drawn once in their own layer (again only when the region changes). */ +private fun Modifier.rushSky(look: RegionLook): Modifier = graphicsLayer().drawWithCache { val w = size.width; val h = size.height val rnd = java.util.Random(7) val stars = FloatArray(120 * 3) { k -> when (k % 3) { 0 -> rnd.nextFloat() * w; 1 -> rnd.nextFloat() * h * .4f; else -> .5f + rnd.nextFloat() * 1.5f } } val horizon = h * HORIZON; val base = h val track = Path().apply { moveTo(w / 2 - LANE_W * w * .2f * 1.5f, horizon); lineTo(w / 2 + LANE_W * w * .2f * 1.5f, horizon); lineTo(w / 2 + LANE_W * w * 1.5f, base); lineTo(w / 2 - LANE_W * w * 1.5f, base); close() } onDrawBehind { - drawRect(Brush.verticalGradient(listOf(Color(0xFF040A1E), Color(0xFF0E1A48)), 0f, horizon)) - drawRect(Color(0xFF060C24), Offset(0f, horizon), Size(w, h - horizon)) + drawRect(Brush.verticalGradient(listOf(look.skyTop, look.skyLow), 0f, horizon)) + drawRect(look.ground, Offset(0f, horizon), Size(w, h - horizon)) for (i in 0 until 120) drawCircle(Color.White.copy(alpha = .3f + stars[i * 3 + 2] / 5), stars[i * 3 + 2], Offset(stars[i * 3], stars[i * 3 + 1])) - drawPath(track, RColours.Track) - for (b in 0..3) { val off = b - 1.5f; drawLine(RColours.Edge, Offset(w / 2 + off * LANE_W * w * .2f, horizon), Offset(w / 2 + off * LANE_W * w, base), 2f) } + drawPath(track, look.track) + for (b in 0..3) { val off = b - 1.5f; drawLine(look.edge, Offset(w / 2 + off * LANE_W * w * .2f, horizon), Offset(w / 2 + off * LANE_W * w, base), 2f) } } } @@ -192,52 +360,71 @@ private fun Modifier.rushSky(): Modifier = graphicsLayer().drawWithCache { private const val HORIZON = .34f private const val LANE_W = .2f -/** The perspective: a thing at distance [z] is drawn at scale s (1 at Blaze, .2 at the horizon) and at height y. */ +/** The perspective: a thing at distance [z] is drawn at scale s (1 at the pilot, .2 at the horizon) and at height y. */ private fun scaleAt(z: Float) = 1f / (1f + 4f * (z / FAR)) private fun DrawScope.yAt(s: Float) = size.height * HORIZON + (size.height * .9f - size.height * HORIZON) * (s - .2f) / .8f private fun DrawScope.xAt(laneX: Float, s: Float) = size.width / 2 + (laneX - 1f) * LANE_W * size.width * s -/** The up/down marker's shape, made once and reused each frame (drawing runs on the one UI thread). */ -private val markerPath = androidx.compose.ui.graphics.Path() - -private fun DrawScope.drawRush(art: OrbiteroidsArt, s: RushSim, calm: Boolean, steady: Boolean) { +private fun DrawScope.drawRush(art: RushArt, s: RushSim, calm: Boolean, steady: Boolean, gentle: Boolean) { val w = size.width; val h = size.height + val look = RegionLooks[s.region] // Dashes rushing past on the lane lines (still with Reduce motion). val shift = if (calm) 0f else (s.distance % 10f) / 10f + val dash = if (s.secretFor > 0f) SecretLook.edge else look.edge for (b in 0..3) for (k in 0 until 8) { val z = FAR * (1f - (k + shift) / 8f) val sc = scaleAt(z); val off = b - 1.5f - drawCircle(RColours.Edge.copy(alpha = .4f + .6f * sc), 2f + 3f * sc, Offset(w / 2 + off * LANE_W * w * sc, yAt(sc))) + drawCircle(dash.copy(alpha = .4f + .6f * sc), 2f + 3f * sc, Offset(w / 2 + off * LANE_W * w * sc, yAt(sc))) } // Warnings: a lane lights in the colour of what's coming down it (steady with Reduce flashing). for (i in 0 until RushSim.MAX) { - if (!s.on[i] || s.kind[i] > RKind.TALL || s.z[i] > WARN) continue + if (!s.on[i] || s.kind[i] > RKind.TALL || s.z[i] > s.warnAt) continue val a = if (steady) .35f else .25f + .15f * kotlin.math.sin(s.clock * 12f) val sc = scaleAt(0f) drawRect(RColours.warn(s.kind[i]).copy(alpha = a), Offset(xAt(s.laneOf[i].toFloat(), sc) - LANE_W * w * .5f, h * .9f), Size(LANE_W * w, h * .06f)) } + // The Static Zone glitches: hazards shiver a little (never with Reduce motion or flashing, nor on Gentle). + val shiver = s.region == RRegion.STATIC && !steady && !gentle // Far things first, so near ones are drawn over them. for (pass in 0 until 2) for (i in 0 until RushSim.MAX) { if (!s.on[i]) continue val z = s.z[i] if ((pass == 0) != (z > FAR / 2)) continue - val sc = scaleAt(z); val x = xAt(s.laneOf[i].toFloat(), sc); val y = yAt(sc); val u = LANE_W * w * sc + val sc = scaleAt(z); val u = LANE_W * w * sc + val x = xAt(s.laneOf[i].toFloat(), sc) + if (shiver && s.kind[i] <= RKind.TALL) u * .03f * kotlin.math.sin(s.clock * 40f + i) else 0f + val y = yAt(sc) when (s.kind[i]) { - // A rock: a big chunky boulder filling the lane. - RKind.ROCK -> { drawCircle(RColours.RockDark, u * .42f, Offset(x, y - u * .3f)); drawCircle(RColours.Rock, u * .36f, Offset(x - u * .04f, y - u * .34f)); drawCircle(RColours.RockDark, u * .08f, Offset(x + u * .1f, y - u * .42f)) } - // A low satellite: a wide flat bar along the track (rise over it). - RKind.LOW -> { drawRect(RColours.Low, Offset(x - u * .45f, y - u * .16f), Size(u * .9f, u * .14f)); drawRect(RColours.Panel, Offset(x - u * .42f, y - u * .14f), Size(u * .3f, u * .1f)); drawRect(RColours.Panel, Offset(x + u * .12f, y - u * .14f), Size(u * .3f, u * .1f)) } - // A tall signal gate: two posts and a bar overhead, a gap underneath (dive under it). - RKind.TALL -> { drawRect(RColours.Tall, Offset(x - u * .45f, y - u * .9f), Size(u * .08f, u * .9f)); drawRect(RColours.Tall, Offset(x + u * .37f, y - u * .9f), Size(u * .08f, u * .9f)); drawRect(RColours.Tall, Offset(x - u * .45f, y - u * .9f), Size(u * .9f, u * .3f)) } - RKind.STAR -> drawPath(starPath(Offset(x, y - u * .3f), u * .16f, u * .07f, 0f), RColours.Star) - RKind.SHIELD -> { drawCircle(RColours.Shield, u * .18f, Offset(x, y - u * .3f)); drawCircle(Color.White, u * .18f, Offset(x, y - u * .3f), style = Stroke(u * .03f)) } + RKind.ROCK -> block(s.region, look, x, y, u, art) + RKind.LOW -> low(s.region, look, x, y, u) + RKind.TALL -> tall(s.region, look, x, y, u) + RKind.STAR -> with(art) { starAt(Offset(x, y - u * .3f), u * .16f) } + RKind.POWER -> { + val c = Offset(x, y - u * .3f); val col = RColours.power(s.power[i]) + drawCircle(col, u * .18f, c); drawCircle(Color.White, u * .18f, c, style = Stroke(u * .03f)) + when (s.power[i]) { + RPower.SHIELD -> drawCircle(Color.White, u * .09f, c, style = Stroke(u * .03f)) + RPower.MAGNET -> { + drawLine(Color.White, Offset(c.x - u * .07f, c.y - u * .07f), Offset(c.x - u * .07f, c.y + u * .04f), u * .035f) + drawLine(Color.White, Offset(c.x + u * .07f, c.y - u * .07f), Offset(c.x + u * .07f, c.y + u * .04f), u * .035f) + drawLine(Color.White, Offset(c.x - u * .07f, c.y + u * .04f), Offset(c.x + u * .07f, c.y + u * .04f), u * .035f) + } + else -> { drawCircle(Color.White, u * .04f, Offset(c.x - u * .05f, c.y)); drawCircle(Color.White, u * .04f, Offset(c.x + u * .05f, c.y)) } + } + } + RKind.PORTAL -> { + val c = Offset(x, y - u * .45f) + drawCircle(RColours.Portal.copy(alpha = .35f), u * .46f, c) + drawCircle(RColours.Portal, u * .46f, c, style = Stroke(u * .07f)) + drawCircle(Color(0xFF00005A), u * .36f, c) + val sign = art.portalSign + val k = (u * .5f) / sign.size.width.coerceAtLeast(1) + scale(k, k, c) { drawText(sign, topLeft = Offset(c.x - sign.size.width / 2f, c.y - sign.size.height / 2f)) } + } } } - // Blaze's rocket (Paul, 9 November 2026: "harder to tell when you jump"). Up or down reads four ways at once: his - // shadow on the track (small and faint when he's risen, big and dark when he's dived), the rocket itself (bigger as he - // comes up towards you, smaller down low), how high he sits, and a marker in the colour of what it gets him past: - // yellow ▲ over a low satellite, cyan ▼ under a gate, with a bar for how long he stays there. Nothing flashes, and with - // Reduce motion he still moves (the shadow and marker don't depend on it). + // The pilot (Paul, 9 November 2026: "harder to tell when you jump"). Up or down reads four ways at once: the shadow on + // the track (small and faint when risen, big and dark when dived), the rocket's size, how high it sits, and a marker in + // the colour of what it gets them past (yellow ▲, cyan ▼) with a bar for how long they stay there. val bx = xAt(s.laneX, 1f) val k = h / 260f val lift = s.lift @@ -246,14 +433,17 @@ private fun DrawScope.drawRush(art: OrbiteroidsArt, s: RushSim, calm: Boolean, s val shadowW = 30f * k * (1f - .45f * lift.coerceAtLeast(0f) + .15f * (-lift).coerceAtLeast(0f)) drawOval(Color.Black.copy(alpha = .45f - .25f * lift.coerceAtLeast(0f) + .1f * (-lift).coerceAtLeast(0f)), Offset(bx - shadowW, ground - shadowW * .28f), Size(shadowW * 2f, shadowW * .56f)) val shipScale = k * (1f + .3f * lift.coerceAtLeast(0f) - .22f * (-lift).coerceAtLeast(0f)) - if (s.shieldFor > 0f) drawCircle(RColours.Shield.copy(alpha = .3f), 34f * shipScale, Offset(bx, by)) - scale(shipScale, shipScale, Offset(bx, by)) { with(art) { ship(bx, by, 0f, s.hurtFor > 0f, if (calm) 1f else kotlin.math.sin(s.clock * 30f)) } } + // Speed Burst: streaks behind (none with Reduce motion); shields: a bubble in their colour; the magnet: a ring. + if (s.burstFor > 0f && !calm) for (j in 0 until 6) { val sx = bx + (j - 2.5f) * 7f * k; drawLine(pilotColour(s.pilot).copy(alpha = .5f), Offset(sx, by + 20f * shipScale), Offset(sx, by + (46f + (j % 3) * 10f) * shipScale), 2f * k) } + if (s.shielded) drawCircle((if (s.abilityShieldFor > 0f) pilotColour(s.pilot) else RColours.Shield).copy(alpha = .3f), 34f * shipScale, Offset(bx, by)) + if (s.active == RPower.MAGNET && s.activeFor > 0f) drawCircle(RColours.Magnet.copy(alpha = .5f), 40f * shipScale, Offset(bx, by), style = Stroke(2f * k)) + scale(shipScale, shipScale, Offset(bx, by)) { with(art) { rocket(bx, by, s, if (calm) 1f else kotlin.math.sin(s.clock * 30f)) } } if (s.height != RHeight.LEVEL && s.heightFor > 0f) { val up = s.height == RHeight.RISE val c = RColours.warn(if (up) RKind.LOW else RKind.TALL) val my = if (up) by - 40f * shipScale else by + 34f * shipScale val a = 13f * k - val arrow = markerPath.apply { + val arrow = art.marker.apply { reset() if (up) { moveTo(bx, my - a); lineTo(bx + a, my); lineTo(bx - a, my) } else { moveTo(bx, my + a); lineTo(bx + a, my); lineTo(bx - a, my) } close() @@ -264,8 +454,58 @@ private fun DrawScope.drawRush(art: OrbiteroidsArt, s: RushSim, calm: Boolean, s drawRect(c.copy(alpha = .3f), Offset(bx - 16f * k, barY), Size(32f * k, 3f * k)) drawRect(c, Offset(bx - 16f * k, barY), Size(32f * k * left, 3f * k)) } - // The static storm behind, closer as he's hit: a band of grey along the bottom (dots still with Reduce motion). + // Slow-mo: the world takes on Drift's cool blue. Warp Ahead: a soft fade of Zip's pink (gentler with Reduce flashing). + if (s.slowFor > 0f) drawRect(OrbCharacter.Drift.colour.copy(alpha = .12f), Offset.Zero, size) + if (s.warpFor > 0f) drawRect(OrbCharacter.Zip.colour.copy(alpha = (if (steady) .12f else .35f) * (s.warpFor / .6f)), Offset.Zero, size) + // The static storm behind, closer at each hit: a band of grey along the bottom (no dots with Reduce motion, nor on Gentle). val band = h * (.06f + .14f * (1f - s.storm)) drawRect(Brush.verticalGradient(listOf(Color.Transparent, Color(0xFF8D95AE).copy(alpha = .55f)), h - band, h), Offset(0f, h - band), Size(w, band)) - if (!calm) for (k2 in 0 until 40) { val sx = ((k2 * 97 + (s.clock * 400).toInt() * 13) % 1000) / 1000f * w; val sy = h - band * (((k2 * 37) % 100) / 100f); drawRect(Color.White.copy(alpha = .35f), Offset(sx, sy), Size(3f, 2f)) } + if (!calm && !gentle) for (k2 in 0 until 40) { val sx = ((k2 * 97 + (s.clock * 400).toInt() * 13) % 1000) / 1000f * w; val sy = h - band * (((k2 * 37) % 100) / 100f); drawRect(Color.White.copy(alpha = .35f), Offset(sx, sy), Size(3f, 2f)) } +} + +/** Solid in its lane at every height (red: change lane). Each region's own: a rock, a broken TV, a rogue-pixel cluster, a dark crystal. */ +private fun DrawScope.block(region: Int, look: RegionLook, x: Float, y: Float, u: Float, art: RushArt) { + when (region) { + RRegion.ALLEY -> { drawCircle(look.blockDark, u * .42f, Offset(x, y - u * .3f)); drawCircle(look.block, u * .36f, Offset(x - u * .04f, y - u * .34f)); drawCircle(look.blockDark, u * .08f, Offset(x + u * .1f, y - u * .42f)) } + RRegion.BOULEVARD -> { + // A broken old telly: its cabinet, a cracked grey screen, two knobs. + drawRect(look.block, Offset(x - u * .4f, y - u * .66f), Size(u * .8f, u * .6f)) + drawRect(Color(0xFF8D95AE), Offset(x - u * .32f, y - u * .58f), Size(u * .5f, u * .44f)) + drawLine(look.blockDark, Offset(x - u * .25f, y - u * .52f), Offset(x - u * .05f, y - u * .3f), u * .025f) + drawLine(look.blockDark, Offset(x - u * .05f, y - u * .3f), Offset(x + u * .1f, y - u * .45f), u * .025f) + drawCircle(look.edge, u * .04f, Offset(x + u * .28f, y - u * .5f)); drawCircle(look.edge, u * .04f, Offset(x + u * .28f, y - u * .34f)) + } + RRegion.STATIC -> { + // Rogue pixels: a chunky cluster of squares. + val p = u * .17f + for (r in 0 until 3) for (c in 0 until 3) if ((r + c) % 3 != 2) drawRect(if ((r * 3 + c) % 2 == 0) look.block else look.blockDark, Offset(x - u * .3f + c * p * 1.15f, y - u * .66f + r * p * 1.15f), Size(p, p)) + } + else -> { + // A dark crystal of the forbidden frequency. + val path = art.crystal.apply { reset(); moveTo(x, y - u * .8f); lineTo(x + u * .32f, y - u * .3f); lineTo(x, y - u * .05f); lineTo(x - u * .32f, y - u * .3f); close() } + drawPath(path, look.block); drawLine(look.lowLight, Offset(x, y - u * .8f), Offset(x, y - u * .05f), u * .02f) + } + } +} + +/** Low along the track (yellow: rise over it): a satellite, a dish array, an interference band, a barrier of the 999 frequency. */ +private fun DrawScope.low(region: Int, look: RegionLook, x: Float, y: Float, u: Float) { + when (region) { + RRegion.ALLEY -> { drawRect(look.low, Offset(x - u * .45f, y - u * .16f), Size(u * .9f, u * .14f)); drawRect(look.lowLight, Offset(x - u * .42f, y - u * .14f), Size(u * .3f, u * .1f)); drawRect(look.lowLight, Offset(x + u * .12f, y - u * .14f), Size(u * .3f, u * .1f)) } + RRegion.BOULEVARD -> { drawRect(look.low, Offset(x - u * .45f, y - u * .1f), Size(u * .9f, u * .08f)); for (d in -1..1) drawArc(look.lowLight, 200f, 140f, false, Offset(x + d * u * .3f - u * .1f, y - u * .26f), Size(u * .2f, u * .2f), style = Stroke(u * .03f)) } + RRegion.STATIC -> { for (j in 0 until 5) drawLine(if (j % 2 == 0) look.lowLight else look.low, Offset(x - u * .45f + j * u * .18f, y - u * .2f + (j % 2) * u * .1f), Offset(x - u * .27f + j * u * .18f, y - u * .1f - (j % 2) * u * .1f), u * .05f) } + else -> { drawRect(look.low, Offset(x - u * .45f, y - u * .18f), Size(u * .9f, u * .14f)); for (j in 0 until 3) drawCircle(look.lowLight, u * .035f, Offset(x - u * .25f + j * u * .25f, y - u * .11f)) } + } +} + +/** Tall with a gap underneath (cyan: dive under it): a signal gate in each region's colours. */ +private fun DrawScope.tall(region: Int, look: RegionLook, x: Float, y: Float, u: Float) { + drawRect(look.tall, Offset(x - u * .45f, y - u * .9f), Size(u * .08f, u * .9f)); drawRect(look.tall, Offset(x + u * .37f, y - u * .9f), Size(u * .08f, u * .9f)) + drawRect(look.tall, Offset(x - u * .45f, y - u * .9f), Size(u * .9f, u * .3f)) + when (region) { + RRegion.BOULEVARD -> { drawLine(look.tall, Offset(x, y - u * .9f), Offset(x, y - u * 1.1f), u * .03f); drawCircle(Color(0xFFFFDE59), u * .04f, Offset(x, y - u * 1.1f)) } + RRegion.STATIC -> for (j in 0 until 4) drawRect(Color.White.copy(alpha = .5f), Offset(x - u * .38f + j * u * .2f, y - u * .84f), Size(u * .08f, u * .05f)) + RRegion.FORBIDDEN -> drawCircle(look.lowLight, u * .06f, Offset(x, y - u * .75f)) + else -> {} + } } diff --git a/android/app/src/main/java/tv/orbit/classic/arcade/rush/RushSim.kt b/android/app/src/main/java/tv/orbit/classic/arcade/rush/RushSim.kt index 0fd7a948..3a6002c0 100644 --- a/android/app/src/main/java/tv/orbit/classic/arcade/rush/RushSim.kt +++ b/android/app/src/main/java/tv/orbit/classic/arcade/rush/RushSim.kt @@ -3,57 +3,108 @@ package tv.orbit.classic.arcade.rush import tv.orbit.classic.arcade.Difficulty /** - * Orbit Rush (prototype, 9 November 2026, from Paul's idea): Blaze flies forward on his own down three lanes through - * Asteroid Alley, a static storm close behind. ◀▶ change lane, ▲ rises over a low satellite, ▼ dives under a tall - * signal gate; rocks block a lane at every height, so only a lane change gets round one. Stars to collect, and one - * power-up (Orbit Shield) held until OK. Three hull bars. + * Orbit Rush (9 November 2026, from Paul's idea; the prototype, then the full game): a pilot of the cast flies forward on + * their own down three lanes through the Orbit universe, a static storm close behind. ◀▶ change lane, ▲ rises over a low + * thing, ▼ dives under a tall one; whatever blocks a lane at every height needs a lane change. Every hazard lights its lane + * first in the colour of the move it wants: red, change lane; yellow, rise; cyan, dive. The same three moves all the way. + * + * The regions, in order as the distance builds: Asteroid Alley, Broadcast Boulevard, The Static Zone and The Forbidden + * Frequency, where a portal marked 999 now and then opens a secret route (all stars, no hazards, and the wizard of page + * 999 tips his hat). Stars, three power-ups held until OK (Orbit Shield, Star Magnet, Double Stars), and each pilot's own + * ability, charged by stars and set off with OK when no power-up is held. * * 2.5D: the sim works in lanes and distance ahead; the screen draws it in perspective. Fixed 60 Hz steps over pooled * arrays: nothing is made while it runs (checked by RushSimTest). */ internal const val RSTEP = 1f / 60f internal const val LANES = 3 -/** How far ahead things appear, and where they're first shown with a warning on their lane. */ +/** How far ahead things appear. */ internal const val FAR = 100f +/** Where a hazard's lane warning comes on (Gentle sooner: [RushSim.warnAt]). */ internal const val WARN = 55f -internal object RKind { const val ROCK = 0; const val LOW = 1; const val TALL = 2; const val STAR = 3; const val SHIELD = 4 } +internal object RKind { + const val ROCK = 0; const val LOW = 1; const val TALL = 2 + const val STAR = 3; const val POWER = 4; const val PORTAL = 5 +} -/** Blaze's height: level, rising over a low thing, or diving under a tall one. */ +/** The pilot's height: level, rising over a low thing, or diving under a tall one. */ internal object RHeight { const val LEVEL = 0; const val RISE = 1; const val DIVE = 2 } -internal object REvents { const val STAR = 1; const val HIT = 2; const val DODGE = 4; const val POWER = 8; const val SHIELD_ON = 16; const val OVER = 32 } +/** The power-ups, held until OK. */ +internal object RPower { + const val NONE = 0; const val SHIELD = 1; const val MAGNET = 2; const val DOUBLE = 3 + val titles = arrayOf("", "Orbit Shield", "Star Magnet", "Double Stars") + val seconds = floatArrayOf(0f, 6f, 7f, 8f) +} + +/** The regions, by how far the run has come. */ +internal object RRegion { + const val ALLEY = 0; const val BOULEVARD = 1; const val STATIC = 2; const val FORBIDDEN = 3 + val names = arrayOf("Asteroid Alley", "Broadcast Boulevard", "The Static Zone", "The Forbidden Frequency") + val starts = floatArrayOf(0f, 2_500f, 6_000f, 10_000f) + fun at(distance: Float): Int { var r = 0; for (i in starts.indices) if (distance >= starts[i]) r = i; return r } +} + +/** The cast, each with one ability (Paul: "Blaze could get a speed burst, Luna a protective shield and Drift a temporary slow-motion"). */ +internal enum class RPilot(val title: String, val ability: String, val line: String) { + Ollie("Ollie", "Patch Up", "Mends a bar of hull, or a short shield when it's full"), + Blaze("Blaze", "Speed Burst", "Three seconds flat out, smashing through anything"), + Zip("Zip", "Warp Ahead", "Jumps ahead, clearing the track in front"), + Drift("Drift", "Slow-mo", "Five seconds of everything slowed right down"), + Luna("Luna", "Moon Shield", "Six seconds of shield"), +} + +internal object REvents { + const val STAR = 1; const val HIT = 2; const val DODGE = 4; const val POWER = 8; const val POWER_ON = 16; const val OVER = 32 + const val REGION = 64; const val ABILITY = 128; const val PORTAL = 256; const val SECRET_END = 512; const val SMASH = 1024; const val CHARGED = 2048 +} internal class RushSim(var difficulty: Difficulty = Difficulty.Normal, seed: Long = 1) { private var rnd = java.util.Random(seed) + var pilot = RPilot.Blaze - // ---------- Blaze ---------- - /** The lane he's in or heading for (0 left, 1 middle, 2 right), and where he's drawn, sliding between lanes. */ + // ---------- the pilot ---------- + /** The lane they're in or heading for (0 left, 1 middle, 2 right), and where they're drawn, sliding between lanes. */ var lane = 1; var laneX = 1f var height = RHeight.LEVEL; var heightFor = 0f - /** Where he's drawn up or down: 1 risen, -1 dived, 0 level, easing between so the move can be seen. */ + /** Where they're drawn up or down: 1 risen, -1 dived, 0 level, easing between so the move can be seen. */ var lift = 0f - var hull = HULL; var hurtFor = 0f - /** Orbit Shield: held until OK, then on for a while. */ - var shieldHeld = false; var shieldFor = 0f + var hull = HULL; var hullMax = HULL; var hurtFor = 0f + /** The power-up held until OK, and the one switched on with its time left. */ + var held = RPower.NONE; var active = RPower.NONE; var activeFor = 0f + /** The ability's charge (1 is ready), and what it's doing now. */ + var charge = 0f; var burstFor = 0f; var slowFor = 0f; var abilityShieldFor = 0f; var warpFor = 0f - // ---------- the alley ---------- - val kind = IntArray(MAX); val laneOf = IntArray(MAX); val z = FloatArray(MAX); val on = BooleanArray(MAX) - var distance = 0f; var speed = 0f; var stars = 0; var dodged = 0 + // ---------- the run ---------- + val kind = IntArray(MAX); val laneOf = IntArray(MAX); val z = FloatArray(MAX); val on = BooleanArray(MAX); val power = IntArray(MAX) + var distance = 0f; var speed = 0f; var stars = 0; var dodged = 0; var bonus = 0 var over = false; var clock = 0f - private var spawnIn = 0f - /** The static storm: how far behind (1 far, 0 on his tail); it closes in when he's hit and drifts back as he flies on. */ + var region = RRegion.ALLEY + /** The secret route behind the 999 portal: seconds left on it, and how many times it's been found. */ + var secretFor = 0f; var portals = 0 + private var spawnIn = 0f; private var portalIn = PORTAL_ROWS + /** The static storm: how far behind (1 far, 0 on the tail); it closes in at a hit and drifts back as the run goes on. */ var storm = 1f var events = 0 - val score get() = distance.toInt() + stars * 10 + val score get() = distance.toInt() + stars * 10 + bonus + val shielded get() = (active == RPower.SHIELD && activeFor > 0f) || abilityShieldFor > 0f + val ready get() = charge >= 1f private val pace get() = when (difficulty) { Difficulty.Gentle -> .78f; Difficulty.Normal -> 1f; Difficulty.Tricky -> 1.18f } + /** Gentle shows each warning sooner. */ + val warnAt get() = if (difficulty == Difficulty.Gentle) 66f else WARN + /** How fast the world is coming at them now: Slow-mo nearly halves it, a Speed Burst nearly doubles it. */ + val worldSpeed get() = speed * (if (slowFor > 0f) SLOW else 1f) * (if (burstFor > 0f) BURST else 1f) - fun newRun(d: Difficulty, seed: Long) { - difficulty = d; rnd = java.util.Random(seed) - lane = 1; laneX = 1f; height = RHeight.LEVEL; heightFor = 0f; lift = 0f; hull = HULL; hurtFor = 0f; shieldHeld = false; shieldFor = 0f - on.fill(false); distance = 0f; speed = START_SPEED * pace; stars = 0; dodged = 0; over = false; clock = 0f; spawnIn = 1.2f; storm = 1f; events = 0 + fun newRun(d: Difficulty, seed: Long, who: RPilot = pilot) { + difficulty = d; rnd = java.util.Random(seed); pilot = who + hullMax = if (d == Difficulty.Gentle) HULL + 1 else HULL + lane = 1; laneX = 1f; height = RHeight.LEVEL; heightFor = 0f; lift = 0f; hull = hullMax; hurtFor = 0f + held = RPower.NONE; active = RPower.NONE; activeFor = 0f; charge = 0f; burstFor = 0f; slowFor = 0f; abilityShieldFor = 0f; warpFor = 0f + on.fill(false); distance = 0f; speed = START_SPEED * pace; stars = 0; dodged = 0; bonus = 0; over = false; clock = 0f + region = RRegion.ALLEY; secretFor = 0f; portals = 0; spawnIn = 1.2f; portalIn = PORTAL_ROWS; storm = 1f; events = 0 } // ---------- the remote ---------- @@ -61,18 +112,36 @@ internal class RushSim(var difficulty: Difficulty = Difficulty.Normal, seed: Lon fun right() { if (!over && lane < LANES - 1) lane++ } fun rise() { if (!over) { height = RHeight.RISE; heightFor = MOVE_TIME } } fun dive() { if (!over) { height = RHeight.DIVE; heightFor = MOVE_TIME } } - /** OK: the held power-up goes on. */ - fun usePower(): Boolean { if (over || !shieldHeld) return false; shieldHeld = false; shieldFor = SHIELD_TIME; events = events or REvents.SHIELD_ON; return true } + + /** OK: the held power-up goes on; with none held, the pilot's ability when it's charged. False when there's nothing to use. */ + fun usePower(): Boolean { + if (over) return false + if (held != RPower.NONE) { active = held; activeFor = RPower.seconds[held]; held = RPower.NONE; events = events or REvents.POWER_ON; return true } + if (!ready) return false + charge = 0f + when (pilot) { + RPilot.Ollie -> if (hull < hullMax) hull++ else abilityShieldFor = 3f + RPilot.Blaze -> burstFor = 3f + RPilot.Zip -> { warpFor = .6f; for (i in 0 until MAX) if (on[i] && z[i] < FAR * .8f) { if (kind[i] <= RKind.TALL) dodged++; on[i] = false }; distance += 150f } + RPilot.Drift -> slowFor = 5f + RPilot.Luna -> abilityShieldFor = 6f + } + events = events or REvents.ABILITY + return true + } fun step() { events = 0 if (over) return val dt = RSTEP clock += dt - // Faster the further he goes, to a limit. - speed = minOf(MAX_SPEED, (START_SPEED + distance * .012f)) * pace - distance += speed * dt - // Lanes slide quickly; a rise or dive lasts a moment, then he levels out. + // Faster the further they go, to a limit. + speed = minOf(MAX_SPEED, (START_SPEED + distance * .006f)) * pace + val v = worldSpeed + distance += v * dt + val r = RRegion.at(distance) + if (r != region) { region = r; events = events or REvents.REGION } + // Lanes slide quickly; a rise or dive lasts a moment, then they level out. laneX += (lane - laneX) * minOf(1f, LANE_SNAP * dt) if (kotlin.math.abs(lane - laneX) < .01f) laneX = lane.toFloat() if (heightFor > 0f) { heightFor -= dt; if (heightFor <= 0f) height = RHeight.LEVEL } @@ -80,61 +149,99 @@ internal class RushSim(var difficulty: Difficulty = Difficulty.Normal, seed: Lon lift += (target - lift) * minOf(1f, LIFT_SNAP * dt) if (kotlin.math.abs(target - lift) < .01f) lift = target if (hurtFor > 0f) hurtFor -= dt - if (shieldFor > 0f) shieldFor -= dt - storm = minOf(1f, storm + dt * .02f) - // Everything comes towards him; whatever reaches him is met. + if (activeFor > 0f) { activeFor -= dt; if (activeFor <= 0f) active = RPower.NONE } + if (burstFor > 0f) burstFor -= dt + if (slowFor > 0f) slowFor -= dt + if (abilityShieldFor > 0f) abilityShieldFor -= dt + if (warpFor > 0f) warpFor -= dt + val wasReady = ready + if (!ready) charge = minOf(1f, charge + dt / CHARGE_SECONDS) + storm = minOf(1f, storm + dt * (if (difficulty == Difficulty.Gentle) .03f else .02f)) + if (secretFor > 0f) { secretFor -= dt; if (secretFor <= 0f) { events = events or REvents.SECRET_END; spawnIn = 1f } } + // Everything comes towards them; whatever reaches them is met. for (i in 0 until MAX) { if (!on[i]) continue - z[i] -= speed * dt + z[i] -= v * dt if (z[i] > 0f) continue on[i] = false - if (laneOf[i] != lane) { if (kind[i] <= RKind.TALL) { dodged++; events = events or REvents.DODGE }; continue } - when (kind[i]) { - RKind.STAR -> { stars++; events = events or REvents.STAR } - RKind.SHIELD -> { shieldHeld = true; events = events or REvents.POWER } + val k = kind[i] + val magnet = active == RPower.MAGNET && k == RKind.STAR + if (laneOf[i] != lane && !magnet) { if (k <= RKind.TALL) { dodged++; events = events or REvents.DODGE }; continue } + when (k) { + RKind.STAR -> { stars += if (active == RPower.DOUBLE) 2 else 1; charge = minOf(1f, charge + STAR_CHARGE); events = events or REvents.STAR } + RKind.POWER -> { held = power[i]; events = events or REvents.POWER } + RKind.PORTAL -> enterSecret() RKind.ROCK -> meet() RKind.LOW -> if (height == RHeight.RISE) { dodged++; events = events or REvents.DODGE } else meet() RKind.TALL -> if (height == RHeight.DIVE) { dodged++; events = events or REvents.DODGE } else meet() } } + if (ready && !wasReady) events = events or REvents.CHARGED // A new row: always at least one way through. - spawnIn -= dt - if (spawnIn <= 0f) { spawnRow(); spawnIn = rowGap() } + spawnIn -= dt * (if (slowFor > 0f) SLOW else 1f) * (if (burstFor > 0f) BURST else 1f) + if (spawnIn <= 0f) { if (secretFor > 0f) starRow() else spawnRow(); spawnIn = rowGap() } } - /** Seconds between rows: shorter as the speed builds; Gentle leaves more room, Tricky less. */ - private fun rowGap() = (when (difficulty) { Difficulty.Gentle -> 1.35f; Difficulty.Normal -> 1.05f; Difficulty.Tricky -> .85f } - distance * .00004f).coerceAtLeast(.6f) + /** Seconds between rows: shorter as the speed builds and in the later regions; Gentle leaves more room, Tricky less. */ + private fun rowGap() = (when (difficulty) { Difficulty.Gentle -> 1.35f; Difficulty.Normal -> 1.05f; Difficulty.Tricky -> .85f } - distance * .00002f - region * .03f) + .coerceAtLeast(if (difficulty == Difficulty.Gentle) .8f else .6f) private fun meet() { - if (hurtFor > 0f || shieldFor > 0f) { dodged++; return } + if (burstFor > 0f) { dodged++; events = events or REvents.SMASH; return } + if (hurtFor > 0f || shielded) { dodged++; return } hull--; hurtFor = HURT_TIME; storm = maxOf(0f, storm - .34f) events = events or REvents.HIT if (hull <= 0) { hull = 0; over = true; events = events or REvents.OVER } } - private fun spawn(k: Int, laneAt: Int) { - for (i in 0 until MAX) if (!on[i]) { on[i] = true; kind[i] = k; laneOf[i] = laneAt; z[i] = FAR; return } + /** Through the 999 portal: the hazards ahead fade away and the secret route opens for a while. */ + private fun enterSecret() { + portals++; secretFor = SECRET_TIME; bonus += 999 + for (i in 0 until MAX) if (on[i] && kind[i] <= RKind.TALL) on[i] = false + events = events or REvents.PORTAL } + private fun spawn(k: Int, laneAt: Int, pw: Int = RPower.NONE) { + for (i in 0 until MAX) if (!on[i]) { on[i] = true; kind[i] = k; laneOf[i] = laneAt; z[i] = FAR; power[i] = pw; return } + } + + /** The secret route: stars in every lane. */ + private fun starRow() { for (l in 0 until LANES) spawn(RKind.STAR, l) } + /** - * A row of hazards: one or two (never all three blocked by rocks), so a lane is always free or a rise or dive gets - * through; stars in a free lane now and then, and a shield once in a while. + * A row of hazards: one or two (never all three lanes blocked by rocks), so a lane is always free or a rise or dive gets + * through. The later regions bring two-hazard rows more often, The Static Zone its interference bands (a low band + * across two lanes: rise over it, or take the free lane). Gentle keeps one hazard a row everywhere. Stars in the free + * lane now and then, a power-up once in a while, and in The Forbidden Frequency, now and then, the 999 portal. */ private fun spawnRow() { - val hazards = if (difficulty == Difficulty.Gentle || rnd.nextInt(3) != 0) 1 else 2 val free = rnd.nextInt(LANES) - var placed = 0 - for (l in 0 until LANES) { - if (l == free || placed >= hazards) continue - val k = when (rnd.nextInt(3)) { 0 -> RKind.ROCK; 1 -> RKind.LOW; else -> RKind.TALL } - spawn(k, l); placed++ + val twoChance = if (region <= RRegion.BOULEVARD) 3 else 2 // one in this many rows has two hazards + val hazards = if (difficulty == Difficulty.Gentle || rnd.nextInt(twoChance) != 0) 1 else 2 + if (region == RRegion.STATIC && difficulty != Difficulty.Gentle && rnd.nextInt(4) == 0) { + for (l in 0 until LANES) if (l != free) spawn(RKind.LOW, l) + } else { + var placed = 0 + for (l in 0 until LANES) { + if (l == free || placed >= hazards) continue + val k = if (region == RRegion.ALLEY) when (rnd.nextInt(4)) { 0, 1 -> RKind.ROCK; 2 -> RKind.LOW; else -> RKind.TALL } + else when (rnd.nextInt(3)) { 0 -> RKind.ROCK; 1 -> RKind.LOW; else -> RKind.TALL } + spawn(k, l); placed++ + } + } + if (region == RRegion.FORBIDDEN && --portalIn <= 0) { spawn(RKind.PORTAL, free); portalIn = PORTAL_ROWS; return } + if (rnd.nextInt(3) == 0) { + if (rnd.nextInt(12) == 0) spawn(RKind.POWER, free, 1 + rnd.nextInt(3)) else spawn(RKind.STAR, free) } - if (rnd.nextInt(3) == 0) spawn(if (rnd.nextInt(14) == 0) RKind.SHIELD else RKind.STAR, free) } companion object { const val MAX = 48; const val HULL = 3 const val START_SPEED = 46f; const val MAX_SPEED = 95f - const val LANE_SNAP = 22f; const val MOVE_TIME = .7f; const val HURT_TIME = 1f; const val SHIELD_TIME = 6f; const val LIFT_SNAP = 16f + const val LANE_SNAP = 22f; const val MOVE_TIME = .7f; const val HURT_TIME = 1f; const val LIFT_SNAP = 16f + const val SLOW = .55f; const val BURST = 1.7f + /** The ability fills in this long on its own, and each star adds a share. */ + const val CHARGE_SECONDS = 40f; const val STAR_CHARGE = .08f + const val SECRET_TIME = 8f; const val PORTAL_ROWS = 22 } } diff --git a/android/app/src/main/res/raw/sfx_rush_boost.ogg b/android/app/src/main/res/raw/sfx_rush_boost.ogg new file mode 100644 index 00000000..a6786eab Binary files /dev/null and b/android/app/src/main/res/raw/sfx_rush_boost.ogg differ diff --git a/android/app/src/main/res/raw/sfx_rush_portal.ogg b/android/app/src/main/res/raw/sfx_rush_portal.ogg new file mode 100644 index 00000000..65d1080e Binary files /dev/null and b/android/app/src/main/res/raw/sfx_rush_portal.ogg differ diff --git a/android/app/src/main/res/raw/sfx_rush_region.ogg b/android/app/src/main/res/raw/sfx_rush_region.ogg new file mode 100644 index 00000000..91f088f1 Binary files /dev/null and b/android/app/src/main/res/raw/sfx_rush_region.ogg differ diff --git a/android/app/src/main/res/raw/sfx_rush_slowmo.ogg b/android/app/src/main/res/raw/sfx_rush_slowmo.ogg new file mode 100644 index 00000000..74cf5b6a Binary files /dev/null and b/android/app/src/main/res/raw/sfx_rush_slowmo.ogg differ diff --git a/android/app/src/test/java/tv/orbit/classic/arcade/SoundKitTest.kt b/android/app/src/test/java/tv/orbit/classic/arcade/SoundKitTest.kt index c7dec81f..e0aec2aa 100644 --- a/android/app/src/test/java/tv/orbit/classic/arcade/SoundKitTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/arcade/SoundKitTest.kt @@ -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) diff --git a/android/app/src/test/java/tv/orbit/classic/arcade/TitleTextFitsTest.kt b/android/app/src/test/java/tv/orbit/classic/arcade/TitleTextFitsTest.kt index 969a17f9..65f9742e 100644 --- a/android/app/src/test/java/tv/orbit/classic/arcade/TitleTextFitsTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/arcade/TitleTextFitsTest.kt @@ -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. diff --git a/android/app/src/test/java/tv/orbit/classic/arcade/rush/RushSimTest.kt b/android/app/src/test/java/tv/orbit/classic/arcade/rush/RushSimTest.kt index d7a2ca65..6a2086e2 100644 --- a/android/app/src/test/java/tv/orbit/classic/arcade/rush/RushSimTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/arcade/rush/RushSimTest.kt @@ -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() + 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) } diff --git a/design/arcade/sounds/build-arcade-sounds.py b/design/arcade/sounds/build-arcade-sounds.py index 9deed3dc..2c8a58fb 100644 --- a/design/arcade/sounds/build-arcade-sounds.py +++ b/design/arcade/sounds/build-arcade-sounds.py @@ -105,6 +105,14 @@ KIT = { "whoosh": (260, -7, [stem("noise-whoosh.wav")], "a lane change, a quick move"), "rise": (300, -7, [synth(SWEEP, [note(C4, 0, 40, 75), note(C5, 40, 200, 75)])], "up and over"), "dive": (300, -7, [synth(SWEEP, [note(C5, 0, 40, 75), note(C4, 40, 200, 75)])], "down and under"), + # ----- Orbit Rush's own (9 November 2026) ----- + "rush_boost": (620, -5, [synth(SWEEP | dict(glide=260), [note(G4 - 12, 0, 60, 80), note(G5, 60, 380, 80)], [SOFT, ROOM]), + stem("noise-rush_boost.wav", db=-8)], "Blaze's Speed Burst: a rising rush"), + "rush_slowmo": (900, -6, [synth(PAD | dict(glide=500, amp_attack=20), [note(E5, 0, 80, 70), note(E4, 80, 700, 70)], [SOFT, CHORUS, PLATE])], "Drift's Slow-mo: everything winds down"), + "rush_portal": (1200, -4, [synth(BELL, run([C5, G5, C6, E6, G5 + 12], 0, 70, 260, 75), [SOFT, PLATE]), + synth(PAD | dict(cutoff=1600), [note(p, 0, 1000, 55) for p in (C4, G4, D5)], [SOFT, CHORUS, PLATE], -6)], "through the 999 portal"), + "rush_region": (900, -4, [synth(KEYS, [note(G4, 0, 160, 80), note(C5, 150, 160, 80), note(E5, 300, 500, 82)], [SOFT, PLATE]), + drums([note(TOM_LO, 300, 200, 55)], dict(tom_decay=300), db=-8)], "a new region of the Orbit universe"), } @@ -157,6 +165,7 @@ def build(name): home = LIBRARY / name; home.mkdir(parents=True, exist_ok=True) if name == "whoosh": noise_stem(home / "noise-whoosh.wav", .26, 300, 2400, .45, 7) if name == "break": noise_stem(home / "noise-break.wav", .3, 1600, 250, .04, 11) + if name == "rush_boost": noise_stem(home / "noise-rush_boost.wav", .6, 250, 3000, .5, 13) sc = home / f"{name}.commands.txt"; sc.write_text(script(length, layers, home)) # The bounce goes in export/ (not kept in git: the session and this script make it again). (home / "export").mkdir(exist_ok=True) diff --git a/design/arcade/sounds/kit-preview.ogg b/design/arcade/sounds/kit-preview.ogg index 6bead988..291f652b 100644 Binary files a/design/arcade/sounds/kit-preview.ogg and b/design/arcade/sounds/kit-preview.ogg differ diff --git a/design/arcade/sounds/library/rush_boost/Audio Files/noise-rush_boost.wav b/design/arcade/sounds/library/rush_boost/Audio Files/noise-rush_boost.wav new file mode 100644 index 00000000..afe4ada7 Binary files /dev/null and b/design/arcade/sounds/library/rush_boost/Audio Files/noise-rush_boost.wav differ diff --git a/design/arcade/sounds/library/rush_boost/noise-rush_boost.wav b/design/arcade/sounds/library/rush_boost/noise-rush_boost.wav new file mode 100644 index 00000000..6bc24353 Binary files /dev/null and b/design/arcade/sounds/library/rush_boost/noise-rush_boost.wav differ diff --git a/design/arcade/sounds/library/rush_boost/rush_boost.commands.txt b/design/arcade/sounds/library/rush_boost/rush_boost.commands.txt new file mode 100644 index 00000000..1d7dd299 --- /dev/null +++ b/design/arcade/sounds/library/rush_boost/rush_boost.commands.txt @@ -0,0 +1,11 @@ +session.new {"name":"sfx","sample_rate":44100} +track.new {"kind": "instrument", "name": "subtractive_synth", "instrument": "subtractive_synth", "format": "stereo"} +mix.instrument {"track": 1, "plugin": "subtractive_synth", "params": {"osc1_wave": 3, "osc2_wave": 2, "osc2_semitones": 7, "osc_mix": 30, "cutoff": 3000, "resonance": 5, "glide": 260, "amp_attack": 10, "amp_decay": 200, "amp_sustain": 40, "amp_release": 90, "level": -6}} +midi.new_clip {"track": 1, "start": 0, "end": 27342} +midi.note_add {"clip": 2, "pitch": 55, "start_ticks": 0, "length_ticks": 115, "velocity": 80} +midi.note_add {"clip": 2, "pitch": 79, "start_ticks": 115, "length_ticks": 729, "velocity": 80} +mix.insert {"track": 1, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.insert {"track": 1, "slot": 1, "plugin": "room_reverb", "params": {"mix": 14, "decay": 0.6, "size": 30}} +file.import_audio {"path": "/home/pauljd/Documents/OrbitTV/orbit-arcade/design/arcade/sounds/library/rush_boost/noise-rush_boost.wav"} +mix.insert {"track": 4, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.volume {"tracks": [4], "db": -8} diff --git a/design/arcade/sounds/library/rush_boost/rush_boost.scraft b/design/arcade/sounds/library/rush_boost/rush_boost.scraft new file mode 100644 index 00000000..24c94c86 --- /dev/null +++ b/design/arcade/sounds/library/rush_boost/rush_boost.scraft @@ -0,0 +1,473 @@ +{ + "format_version": 1, + "name": "rush_boost", + "sample_rate": 44100, + "bit_depth": "Int24", + "frame_rate": "Fps30", + "timecode_start": 0, + "tempo": { + "tempos": [ + { + "tick": 0, + "bpm": 120.0 + } + ], + "meters": [ + { + "tick": 0, + "numerator": 4, + "denominator": 4 + } + ] + }, + "key_signatures": [], + "tracks": [ + { + "id": 1, + "name": "subtractive_synth", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 86, + 132, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "subtractive_synth", + "clips": [ + { + "id": 2, + "name": "subtractive_synth", + "start": 0, + "length": 27342, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 55, + "velocity": 80, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 115 + }, + { + "pitch": 79, + "velocity": 80, + "release_velocity": 64, + "channel": 0, + "start": 115, + "length": 729 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": 0.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "room_reverb", + "params": { + "damping": 6000.0, + "decay": 0.6, + "diffusion": 70.0, + "low_cut": 20.0, + "mix": 14.0, + "pre_delay": 10.0, + "size": 30.0, + "width": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "subtractive_synth", + "params": { + "amp_attack": 10.0, + "amp_decay": 200.0, + "amp_release": 90.0, + "amp_sustain": 40.0, + "cutoff": 3000.0, + "filter_attack": 5.0, + "filter_decay": 300.0, + "filter_env_amount": 30.0, + "filter_release": 300.0, + "filter_sustain": 30.0, + "glide": 260.0, + "level": -6.0, + "osc1_wave": 3.0, + "osc2_detune": 7.0, + "osc2_semitones": 7.0, + "osc2_wave": 2.0, + "osc_mix": 30.0, + "resonance": 5.0, + "velocity": 70.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + }, + { + "id": 4, + "name": "noise-rush_boost", + "kind": "Audio", + "format": "Mono", + "color": [ + 94, + 170, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "noise-rush_boost", + "clips": [ + { + "id": 5, + "name": "noise-rush_boost", + "start": 0, + "length": 26460, + "content": { + "Audio": { + "source": 3, + "offset": 0 + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": -8.0, + "pan": [ + 0.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "waveform", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": null, + "ticks_timebase": false, + "elastic": null, + "pinned": false + } + ], + "sources": [ + { + "id": 3, + "name": "noise-rush_boost", + "path": "Audio Files/noise-rush_boost.wav", + "channels": 1, + "frames": 26460, + "sample_rate": 44100, + "format": "Wav", + "time_reference": 0, + "unsaved": false + } + ], + "videos": [], + "busses": [], + "outputs": [ + { + "name": "Out 1-2", + "first_channel": 0, + "format": "Stereo" + } + ], + "markers": [], + "groups": [], + "auto_names": {}, + "edit": { + "tool": "Smart", + "edit_mode": "Slip", + "selection": { + "start": 0, + "end": 0 + }, + "selected_tracks": [ + 1 + ], + "selected_clips": [], + "selected_sources": [], + "playhead": 0, + "grid": { + "Note": { + "value": "Sixteenth", + "dotted": false, + "triplet": false + } + }, + "nudge": { + "Seconds": 1.0 + }, + "grid_follow_main": false, + "nudge_follow_main": false, + "grid_clips_markers": false, + "grid_lines": true, + "main_counter": "MinSecs", + "sub_counter": "Samples", + "zoom": { + "samples_per_px": 1024.0, + "scroll": 0, + "waveform_zoom": 1.0, + "presets": [ + 64.0, + 256.0, + 1024.0, + 4096.0, + 16384.0 + ] + }, + "zoom_toggle": null, + "rulers": [ + "bars_beats", + "min_secs", + "tempo", + "meter", + "markers" + ], + "link_timeline_edit": true, + "link_track_edit": false, + "insertion_follows_playback": false, + "loop_playback": false, + "pre_post_roll": false, + "pre_roll": 88200, + "post_roll": 88200, + "tab_to_transient": false, + "automation_follows_edit": true, + "markers_follow_edit": false, + "layered_editing": false, + "mirrored_midi": false, + "click": false, + "countoff": false, + "countoff_bars": 2, + "midi_merge": false, + "record_mode": "normal", + "loop_record": false, + "quickpunch": false, + "scrolling": "page", + "solo_mode": "sip", + "pre_fader_metering": false, + "delay_compensation": true, + "keyboard_focus": "commands", + "timeline_selection": { + "start": 0, + "end": 0 + }, + "flags": [ + "view.clip.gain_line", + "view.clip.name", + "view.clip.overlap_shadows", + "view.marker.ruler_lines", + "waveform.peak" + ], + "values": {} + }, + "next_id": 6, + "comments": "", + "midi_originals": {} +} \ No newline at end of file diff --git a/design/arcade/sounds/library/rush_portal/rush_portal.commands.txt b/design/arcade/sounds/library/rush_portal/rush_portal.commands.txt new file mode 100644 index 00000000..f7973151 --- /dev/null +++ b/design/arcade/sounds/library/rush_portal/rush_portal.commands.txt @@ -0,0 +1,21 @@ +session.new {"name":"sfx","sample_rate":44100} +track.new {"kind": "instrument", "name": "subtractive_synth", "instrument": "subtractive_synth", "format": "stereo"} +mix.instrument {"track": 1, "plugin": "subtractive_synth", "params": {"osc1_wave": 2, "osc2_wave": 3, "osc2_semitones": 12, "osc_mix": 18, "cutoff": 5000, "resonance": 0, "amp_attack": 3, "amp_decay": 260, "amp_sustain": 0, "amp_release": 180, "level": -6}} +midi.new_clip {"track": 1, "start": 0, "end": 52920} +midi.note_add {"clip": 2, "pitch": 72, "start_ticks": 0, "length_ticks": 499, "velocity": 75} +midi.note_add {"clip": 2, "pitch": 79, "start_ticks": 134, "length_ticks": 499, "velocity": 75} +midi.note_add {"clip": 2, "pitch": 84, "start_ticks": 268, "length_ticks": 499, "velocity": 75} +midi.note_add {"clip": 2, "pitch": 88, "start_ticks": 403, "length_ticks": 499, "velocity": 75} +midi.note_add {"clip": 2, "pitch": 91, "start_ticks": 537, "length_ticks": 499, "velocity": 75} +mix.insert {"track": 1, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.insert {"track": 1, "slot": 1, "plugin": "plate_reverb", "params": {"mix": 22, "decay": 1.4, "pre_delay": 10}} +track.new {"kind": "instrument", "name": "subtractive_synth", "instrument": "subtractive_synth", "format": "stereo"} +mix.instrument {"track": 3, "plugin": "subtractive_synth", "params": {"osc1_wave": 2, "osc2_wave": 3, "osc2_detune": 8, "osc_mix": 40, "cutoff": 1600, "resonance": 0, "amp_attack": 60, "amp_decay": 400, "amp_sustain": 50, "amp_release": 300, "level": -8}} +midi.new_clip {"track": 3, "start": 0, "end": 52920} +midi.note_add {"clip": 4, "pitch": 60, "start_ticks": 0, "length_ticks": 1920, "velocity": 55} +midi.note_add {"clip": 4, "pitch": 67, "start_ticks": 0, "length_ticks": 1920, "velocity": 55} +midi.note_add {"clip": 4, "pitch": 74, "start_ticks": 0, "length_ticks": 1920, "velocity": 55} +mix.insert {"track": 3, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.insert {"track": 3, "slot": 1, "plugin": "chorus", "params": {"rate": 0.8, "depth": 35, "mix": 30}} +mix.insert {"track": 3, "slot": 2, "plugin": "plate_reverb", "params": {"mix": 22, "decay": 1.4, "pre_delay": 10}} +mix.volume {"tracks": [3], "db": -6} diff --git a/design/arcade/sounds/library/rush_portal/rush_portal.scraft b/design/arcade/sounds/library/rush_portal/rush_portal.scraft new file mode 100644 index 00000000..a5166d91 --- /dev/null +++ b/design/arcade/sounds/library/rush_portal/rush_portal.scraft @@ -0,0 +1,567 @@ +{ + "format_version": 1, + "name": "rush_portal", + "sample_rate": 44100, + "bit_depth": "Int24", + "frame_rate": "Fps30", + "timecode_start": 0, + "tempo": { + "tempos": [ + { + "tick": 0, + "bpm": 120.0 + } + ], + "meters": [ + { + "tick": 0, + "numerator": 4, + "denominator": 4 + } + ] + }, + "key_signatures": [], + "tracks": [ + { + "id": 1, + "name": "subtractive_synth", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 86, + 132, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "subtractive_synth", + "clips": [ + { + "id": 2, + "name": "subtractive_synth", + "start": 0, + "length": 52920, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 72, + "velocity": 75, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 499 + }, + { + "pitch": 79, + "velocity": 75, + "release_velocity": 64, + "channel": 0, + "start": 134, + "length": 499 + }, + { + "pitch": 84, + "velocity": 75, + "release_velocity": 64, + "channel": 0, + "start": 268, + "length": 499 + }, + { + "pitch": 88, + "velocity": 75, + "release_velocity": 64, + "channel": 0, + "start": 403, + "length": 499 + }, + { + "pitch": 91, + "velocity": 75, + "release_velocity": 64, + "channel": 0, + "start": 537, + "length": 499 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": 0.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "plate_reverb", + "params": { + "damping": 10000.0, + "decay": 1.4, + "diffusion": 85.0, + "low_cut": 20.0, + "mix": 22.0, + "pre_delay": 10.0, + "size": 50.0, + "width": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "subtractive_synth", + "params": { + "amp_attack": 3.0, + "amp_decay": 260.0, + "amp_release": 180.0, + "amp_sustain": 0.0, + "cutoff": 5000.0, + "filter_attack": 5.0, + "filter_decay": 300.0, + "filter_env_amount": 30.0, + "filter_release": 300.0, + "filter_sustain": 30.0, + "glide": 0.0, + "level": -6.0, + "osc1_wave": 2.0, + "osc2_detune": 7.0, + "osc2_semitones": 12.0, + "osc2_wave": 3.0, + "osc_mix": 18.0, + "resonance": 0.0, + "velocity": 70.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + }, + { + "id": 3, + "name": "subtractive_synth 1", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 94, + 170, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "subtractive_synth 1", + "clips": [ + { + "id": 4, + "name": "subtractive_synth 1", + "start": 0, + "length": 52920, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 60, + "velocity": 55, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 1920 + }, + { + "pitch": 67, + "velocity": 55, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 1920 + }, + { + "pitch": 74, + "velocity": 55, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 1920 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": -6.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "chorus", + "params": { + "delay": 12.0, + "depth": 35.0, + "feedback": 0.0, + "mix": 30.0, + "rate": 0.8, + "spread": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "plate_reverb", + "params": { + "damping": 10000.0, + "decay": 1.4, + "diffusion": 85.0, + "low_cut": 20.0, + "mix": 22.0, + "pre_delay": 10.0, + "size": 50.0, + "width": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "subtractive_synth", + "params": { + "amp_attack": 60.0, + "amp_decay": 400.0, + "amp_release": 300.0, + "amp_sustain": 50.0, + "cutoff": 1600.0, + "filter_attack": 5.0, + "filter_decay": 300.0, + "filter_env_amount": 30.0, + "filter_release": 300.0, + "filter_sustain": 30.0, + "glide": 0.0, + "level": -8.0, + "osc1_wave": 2.0, + "osc2_detune": 8.0, + "osc2_semitones": 0.0, + "osc2_wave": 3.0, + "osc_mix": 40.0, + "resonance": 0.0, + "velocity": 70.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + } + ], + "sources": [], + "videos": [], + "busses": [], + "outputs": [ + { + "name": "Out 1-2", + "first_channel": 0, + "format": "Stereo" + } + ], + "markers": [], + "groups": [], + "auto_names": {}, + "edit": { + "tool": "Smart", + "edit_mode": "Slip", + "selection": { + "start": 0, + "end": 0 + }, + "selected_tracks": [ + 3 + ], + "selected_clips": [], + "selected_sources": [], + "playhead": 0, + "grid": { + "Note": { + "value": "Sixteenth", + "dotted": false, + "triplet": false + } + }, + "nudge": { + "Seconds": 1.0 + }, + "grid_follow_main": false, + "nudge_follow_main": false, + "grid_clips_markers": false, + "grid_lines": true, + "main_counter": "MinSecs", + "sub_counter": "Samples", + "zoom": { + "samples_per_px": 1024.0, + "scroll": 0, + "waveform_zoom": 1.0, + "presets": [ + 64.0, + 256.0, + 1024.0, + 4096.0, + 16384.0 + ] + }, + "zoom_toggle": null, + "rulers": [ + "bars_beats", + "min_secs", + "tempo", + "meter", + "markers" + ], + "link_timeline_edit": true, + "link_track_edit": false, + "insertion_follows_playback": false, + "loop_playback": false, + "pre_post_roll": false, + "pre_roll": 88200, + "post_roll": 88200, + "tab_to_transient": false, + "automation_follows_edit": true, + "markers_follow_edit": false, + "layered_editing": false, + "mirrored_midi": false, + "click": false, + "countoff": false, + "countoff_bars": 2, + "midi_merge": false, + "record_mode": "normal", + "loop_record": false, + "quickpunch": false, + "scrolling": "page", + "solo_mode": "sip", + "pre_fader_metering": false, + "delay_compensation": true, + "keyboard_focus": "commands", + "timeline_selection": { + "start": 0, + "end": 0 + }, + "flags": [ + "view.clip.gain_line", + "view.clip.name", + "view.clip.overlap_shadows", + "view.marker.ruler_lines", + "waveform.peak" + ], + "values": {} + }, + "next_id": 5, + "comments": "", + "midi_originals": {} +} \ No newline at end of file diff --git a/design/arcade/sounds/library/rush_region/rush_region.commands.txt b/design/arcade/sounds/library/rush_region/rush_region.commands.txt new file mode 100644 index 00000000..a17f0983 --- /dev/null +++ b/design/arcade/sounds/library/rush_region/rush_region.commands.txt @@ -0,0 +1,15 @@ +session.new {"name":"sfx","sample_rate":44100} +track.new {"kind": "instrument", "name": "subtractive_synth", "instrument": "subtractive_synth", "format": "stereo"} +mix.instrument {"track": 1, "plugin": "subtractive_synth", "params": {"osc1_wave": 3, "osc2_wave": 2, "osc2_semitones": 12, "osc_mix": 25, "cutoff": 2600, "resonance": 0, "amp_attack": 6, "amp_decay": 500, "amp_sustain": 25, "amp_release": 380, "level": -8}} +midi.new_clip {"track": 1, "start": 0, "end": 39690} +midi.note_add {"clip": 2, "pitch": 67, "start_ticks": 0, "length_ticks": 307, "velocity": 80} +midi.note_add {"clip": 2, "pitch": 72, "start_ticks": 288, "length_ticks": 307, "velocity": 80} +midi.note_add {"clip": 2, "pitch": 76, "start_ticks": 576, "length_ticks": 960, "velocity": 82} +mix.insert {"track": 1, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.insert {"track": 1, "slot": 1, "plugin": "plate_reverb", "params": {"mix": 22, "decay": 1.4, "pre_delay": 10}} +track.new {"kind": "instrument", "name": "drum_synth", "instrument": "drum_synth", "format": "stereo"} +mix.instrument {"track": 3, "plugin": "drum_synth", "params": {"tom_decay": 300}} +midi.new_clip {"track": 3, "start": 0, "end": 39690} +midi.note_add {"clip": 4, "pitch": 45, "start_ticks": 576, "length_ticks": 384, "velocity": 55} +mix.insert {"track": 3, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.volume {"tracks": [3], "db": -8} diff --git a/design/arcade/sounds/library/rush_region/rush_region.scraft b/design/arcade/sounds/library/rush_region/rush_region.scraft new file mode 100644 index 00000000..570ca428 --- /dev/null +++ b/design/arcade/sounds/library/rush_region/rush_region.scraft @@ -0,0 +1,499 @@ +{ + "format_version": 1, + "name": "rush_region", + "sample_rate": 44100, + "bit_depth": "Int24", + "frame_rate": "Fps30", + "timecode_start": 0, + "tempo": { + "tempos": [ + { + "tick": 0, + "bpm": 120.0 + } + ], + "meters": [ + { + "tick": 0, + "numerator": 4, + "denominator": 4 + } + ] + }, + "key_signatures": [], + "tracks": [ + { + "id": 1, + "name": "subtractive_synth", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 86, + 132, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "subtractive_synth", + "clips": [ + { + "id": 2, + "name": "subtractive_synth", + "start": 0, + "length": 39690, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 67, + "velocity": 80, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 307 + }, + { + "pitch": 72, + "velocity": 80, + "release_velocity": 64, + "channel": 0, + "start": 288, + "length": 307 + }, + { + "pitch": 76, + "velocity": 82, + "release_velocity": 64, + "channel": 0, + "start": 576, + "length": 960 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": 0.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "plate_reverb", + "params": { + "damping": 10000.0, + "decay": 1.4, + "diffusion": 85.0, + "low_cut": 20.0, + "mix": 22.0, + "pre_delay": 10.0, + "size": 50.0, + "width": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "subtractive_synth", + "params": { + "amp_attack": 6.0, + "amp_decay": 500.0, + "amp_release": 380.0, + "amp_sustain": 25.0, + "cutoff": 2600.0, + "filter_attack": 5.0, + "filter_decay": 300.0, + "filter_env_amount": 30.0, + "filter_release": 300.0, + "filter_sustain": 30.0, + "glide": 0.0, + "level": -8.0, + "osc1_wave": 3.0, + "osc2_detune": 7.0, + "osc2_semitones": 12.0, + "osc2_wave": 2.0, + "osc_mix": 25.0, + "resonance": 0.0, + "velocity": 70.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + }, + { + "id": 3, + "name": "drum_synth", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 94, + 170, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "drum_synth", + "clips": [ + { + "id": 4, + "name": "drum_synth", + "start": 0, + "length": 39690, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 45, + "velocity": 55, + "release_velocity": 64, + "channel": 0, + "start": 576, + "length": 384 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": -8.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "drum_synth", + "params": { + "cymbal_decay": 2000.0, + "hat_decay": 80.0, + "kick_decay": 450.0, + "kick_tune": 0.0, + "level": -6.0, + "open_hat_decay": 600.0, + "snare_decay": 220.0, + "snare_snappy": 60.0, + "snare_tune": 0.0, + "tom_decay": 300.0, + "tom_tune": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + } + ], + "sources": [], + "videos": [], + "busses": [], + "outputs": [ + { + "name": "Out 1-2", + "first_channel": 0, + "format": "Stereo" + } + ], + "markers": [], + "groups": [], + "auto_names": {}, + "edit": { + "tool": "Smart", + "edit_mode": "Slip", + "selection": { + "start": 0, + "end": 0 + }, + "selected_tracks": [ + 3 + ], + "selected_clips": [], + "selected_sources": [], + "playhead": 0, + "grid": { + "Note": { + "value": "Sixteenth", + "dotted": false, + "triplet": false + } + }, + "nudge": { + "Seconds": 1.0 + }, + "grid_follow_main": false, + "nudge_follow_main": false, + "grid_clips_markers": false, + "grid_lines": true, + "main_counter": "MinSecs", + "sub_counter": "Samples", + "zoom": { + "samples_per_px": 1024.0, + "scroll": 0, + "waveform_zoom": 1.0, + "presets": [ + 64.0, + 256.0, + 1024.0, + 4096.0, + 16384.0 + ] + }, + "zoom_toggle": null, + "rulers": [ + "bars_beats", + "min_secs", + "tempo", + "meter", + "markers" + ], + "link_timeline_edit": true, + "link_track_edit": false, + "insertion_follows_playback": false, + "loop_playback": false, + "pre_post_roll": false, + "pre_roll": 88200, + "post_roll": 88200, + "tab_to_transient": false, + "automation_follows_edit": true, + "markers_follow_edit": false, + "layered_editing": false, + "mirrored_midi": false, + "click": false, + "countoff": false, + "countoff_bars": 2, + "midi_merge": false, + "record_mode": "normal", + "loop_record": false, + "quickpunch": false, + "scrolling": "page", + "solo_mode": "sip", + "pre_fader_metering": false, + "delay_compensation": true, + "keyboard_focus": "commands", + "timeline_selection": { + "start": 0, + "end": 0 + }, + "flags": [ + "view.clip.gain_line", + "view.clip.name", + "view.clip.overlap_shadows", + "view.marker.ruler_lines", + "waveform.peak" + ], + "values": {} + }, + "next_id": 5, + "comments": "", + "midi_originals": {} +} \ No newline at end of file diff --git a/design/arcade/sounds/library/rush_slowmo/rush_slowmo.commands.txt b/design/arcade/sounds/library/rush_slowmo/rush_slowmo.commands.txt new file mode 100644 index 00000000..6a066c5b --- /dev/null +++ b/design/arcade/sounds/library/rush_slowmo/rush_slowmo.commands.txt @@ -0,0 +1,9 @@ +session.new {"name":"sfx","sample_rate":44100} +track.new {"kind": "instrument", "name": "subtractive_synth", "instrument": "subtractive_synth", "format": "stereo"} +mix.instrument {"track": 1, "plugin": "subtractive_synth", "params": {"osc1_wave": 2, "osc2_wave": 3, "osc2_detune": 8, "osc_mix": 40, "cutoff": 2200, "resonance": 0, "amp_attack": 20, "amp_decay": 400, "amp_sustain": 50, "amp_release": 300, "level": -8, "glide": 500}} +midi.new_clip {"track": 1, "start": 0, "end": 39690} +midi.note_add {"clip": 2, "pitch": 76, "start_ticks": 0, "length_ticks": 153, "velocity": 70} +midi.note_add {"clip": 2, "pitch": 64, "start_ticks": 153, "length_ticks": 1344, "velocity": 70} +mix.insert {"track": 1, "slot": 0, "plugin": "eq_7band", "params": {"hpf_on": 1, "hpf_freq": 90, "high_shelf_gain": -5, "high_shelf_freq": 5500}} +mix.insert {"track": 1, "slot": 1, "plugin": "chorus", "params": {"rate": 0.8, "depth": 35, "mix": 30}} +mix.insert {"track": 1, "slot": 2, "plugin": "plate_reverb", "params": {"mix": 22, "decay": 1.4, "pre_delay": 10}} diff --git a/design/arcade/sounds/library/rush_slowmo/rush_slowmo.scraft b/design/arcade/sounds/library/rush_slowmo/rush_slowmo.scraft new file mode 100644 index 00000000..b3973a21 --- /dev/null +++ b/design/arcade/sounds/library/rush_slowmo/rush_slowmo.scraft @@ -0,0 +1,338 @@ +{ + "format_version": 1, + "name": "rush_slowmo", + "sample_rate": 44100, + "bit_depth": "Int24", + "frame_rate": "Fps30", + "timecode_start": 0, + "tempo": { + "tempos": [ + { + "tick": 0, + "bpm": 120.0 + } + ], + "meters": [ + { + "tick": 0, + "numerator": 4, + "denominator": 4 + } + ] + }, + "key_signatures": [], + "tracks": [ + { + "id": 1, + "name": "subtractive_synth", + "kind": "Instrument", + "format": "Stereo", + "color": [ + 86, + 132, + 214 + ], + "height": "Medium", + "playlists": [ + { + "name": "subtractive_synth", + "clips": [ + { + "id": 2, + "name": "subtractive_synth", + "start": 0, + "length": 39690, + "content": { + "Midi": { + "sequence": { + "notes": [ + { + "pitch": 76, + "velocity": 70, + "release_velocity": 64, + "channel": 0, + "start": 0, + "length": 153 + }, + { + "pitch": 64, + "velocity": 70, + "release_velocity": 64, + "channel": 0, + "start": 153, + "length": 1344 + } + ], + "ctrls": [] + } + } + }, + "gain_db": 0.0, + "gain_env": [], + "fade_in": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "fade_out": { + "len": 0, + "shape": "EqualPower", + "curvature": 0.0 + }, + "muted": false, + "edit_locked": false, + "time_locked": false, + "rating": 0, + "sync_point": 0, + "color": null, + "auto_name": null, + "stretch": 1.0, + "group": null, + "loop_id": null + } + ] + } + ], + "active_playlist": 0, + "mixer": { + "volume_db": 0.0, + "pan": [ + -1.0, + 1.0 + ], + "mute": false, + "solo": false, + "solo_safe": false, + "phase_invert": false, + "input": "None", + "output": "Main", + "inserts": [ + { + "plugin": "eq_7band", + "params": { + "high_mid_freq": 4000.0, + "high_mid_gain": 0.0, + "high_mid_q": 1.0, + "high_shelf_freq": 5500.0, + "high_shelf_gain": -5.0, + "high_shelf_q": 0.707, + "hpf_freq": 90.0, + "hpf_on": 1.0, + "hpf_slope": 1.0, + "input_gain": 0.0, + "low_mid_freq": 250.0, + "low_mid_gain": 0.0, + "low_mid_q": 1.0, + "low_shelf_freq": 100.0, + "low_shelf_gain": 0.0, + "low_shelf_q": 0.707, + "lpf_freq": 18000.0, + "lpf_on": 0.0, + "lpf_slope": 1.0, + "mid_freq": 1000.0, + "mid_gain": 0.0, + "mid_q": 1.0, + "output_gain": 0.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "chorus", + "params": { + "delay": 12.0, + "depth": 35.0, + "feedback": 0.0, + "mix": 30.0, + "rate": 0.8, + "spread": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + { + "plugin": "plate_reverb", + "params": { + "damping": 10000.0, + "decay": 1.4, + "diffusion": 85.0, + "low_cut": 20.0, + "mix": 22.0, + "pre_delay": 10.0, + "size": 50.0, + "width": 100.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + null, + null, + null, + null, + null, + null, + null + ], + "sends": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "automation_mode": "Read", + "trim_db": 0.0, + "vca": null, + "surround": null + }, + "automation": [], + "view": "notes", + "hidden": false, + "inactive": false, + "frozen": false, + "comments": "", + "folder": null, + "folder_open": true, + "instrument": { + "plugin": "subtractive_synth", + "params": { + "amp_attack": 20.0, + "amp_decay": 400.0, + "amp_release": 300.0, + "amp_sustain": 50.0, + "cutoff": 2200.0, + "filter_attack": 5.0, + "filter_decay": 300.0, + "filter_env_amount": 30.0, + "filter_release": 300.0, + "filter_sustain": 30.0, + "glide": 500.0, + "level": -8.0, + "osc1_wave": 2.0, + "osc2_detune": 8.0, + "osc2_semitones": 0.0, + "osc2_wave": 3.0, + "osc_mix": 40.0, + "resonance": 0.0, + "velocity": 70.0 + }, + "bypass": false, + "active": true, + "preset": "" + }, + "ticks_timebase": true, + "elastic": null, + "pinned": false + } + ], + "sources": [], + "videos": [], + "busses": [], + "outputs": [ + { + "name": "Out 1-2", + "first_channel": 0, + "format": "Stereo" + } + ], + "markers": [], + "groups": [], + "auto_names": {}, + "edit": { + "tool": "Smart", + "edit_mode": "Slip", + "selection": { + "start": 0, + "end": 0 + }, + "selected_tracks": [ + 1 + ], + "selected_clips": [], + "selected_sources": [], + "playhead": 0, + "grid": { + "Note": { + "value": "Sixteenth", + "dotted": false, + "triplet": false + } + }, + "nudge": { + "Seconds": 1.0 + }, + "grid_follow_main": false, + "nudge_follow_main": false, + "grid_clips_markers": false, + "grid_lines": true, + "main_counter": "MinSecs", + "sub_counter": "Samples", + "zoom": { + "samples_per_px": 1024.0, + "scroll": 0, + "waveform_zoom": 1.0, + "presets": [ + 64.0, + 256.0, + 1024.0, + 4096.0, + 16384.0 + ] + }, + "zoom_toggle": null, + "rulers": [ + "bars_beats", + "min_secs", + "tempo", + "meter", + "markers" + ], + "link_timeline_edit": true, + "link_track_edit": false, + "insertion_follows_playback": false, + "loop_playback": false, + "pre_post_roll": false, + "pre_roll": 88200, + "post_roll": 88200, + "tab_to_transient": false, + "automation_follows_edit": true, + "markers_follow_edit": false, + "layered_editing": false, + "mirrored_midi": false, + "click": false, + "countoff": false, + "countoff_bars": 2, + "midi_merge": false, + "record_mode": "normal", + "loop_record": false, + "quickpunch": false, + "scrolling": "page", + "solo_mode": "sip", + "pre_fader_metering": false, + "delay_compensation": true, + "keyboard_focus": "commands", + "timeline_selection": { + "start": 0, + "end": 0 + }, + "flags": [ + "view.clip.gain_line", + "view.clip.name", + "view.clip.overlap_shadows", + "view.marker.ruler_lines", + "waveform.peak" + ], + "values": {} + }, + "next_id": 3, + "comments": "", + "midi_originals": {} +} \ No newline at end of file diff --git a/docs/orbit-rush.md b/docs/orbit-rush.md index ada3f37b..b2c621dc 100644 --- a/docs/orbit-rush.md +++ b/docs/orbit-rush.md @@ -50,3 +50,78 @@ From Paul's idea, built as the small prototype he agreed to: to try for feel on Artwork, more regions (Broadcast Boulevard, The Static Zone, The Forbidden Frequency's 999 portal), a choice of pilot with their own abilities, more power-ups, and sounds. + +--- + +# Orbit Rush: the full game (0.122.0, versionCode 313, 9 November 2026) + +Paul tried the prototype ("sounds and feels fine, the prototype works") and said "yeah please" to the full game. +It's built on 0.121.0 (312). The "prototype" label is gone. Not installed. + +## Pilots + +All five of the cast are drawn from the cast library. Only Ollie has a mouth. + +You choose a pilot on the title screen with the ◆ button, and the choice is remembered for each profile. Each pilot has one ability. It charges by itself in about 40 seconds, and each star adds 8%. OK sets it off when no power-up is held. + +| Pilot | Ability | What it does | +|---|---|---| +| Ollie | Patch Up | mends a bar of hull, or gives 3 s of shield when the hull is full | +| Blaze | Speed Burst | 3 s at 1.7× speed, smashing through anything | +| Zip | Warp Ahead | jumps 150 m ahead, clearing the track in front | +| Drift | Slow-mo | 5 s of everything at 55% speed | +| Luna | Moon Shield | 6 s of shield | + +## Regions + +The regions come in order as the distance builds. The warning colours never change, so the three moves read the same all the way: red means change lane, yellow means rise, cyan means dive. + +| From | Region | Look | What changes | +|---|---|---|---| +| 0 m | Asteroid Alley | deep blue, tumbling rocks | more rocks; one row in three has two hazards | +| 2,500 m | Broadcast Boulevard | teal night, broken tellies, dish arrays, signal gates with antennae | an even mix of hazards | +| 6,000 m | The Static Zone | grey-violet, rogue pixels, interference | half the rows have two hazards; interference bands (low across two lanes: rise or take the free lane); hazards shiver (not with Reduce motion or flashing, nor on Gentle) | +| 10,000 m | The Forbidden Frequency | deep purple, dark crystals | every 22 rows the **999 portal** opens in the free lane | + +Flying through the portal opens the secret route: 8 seconds in Orbi-Fax's teletext colours with stars in every lane and no hazards. The wizard of page 999 (the teletext mosaic from Orbi-Raiders) appears on the right as he "tips his hat", and the run gets a 999-point bonus. + +A banner names each region as you enter it ("SECTOR 2 · BROADCAST BOULEVARD"). + +## Power-ups + +Power-ups are held until OK. + +- **Orbit Shield:** 6 s of shield. +- **Star Magnet:** 7 s; stars come to you from every lane. +- **Double Stars:** 8 s; each star counts as 2. + +## Gentle + +Gentle has slower speeds, one hazard a row everywhere (no two-hazard rows or bands), an extra bar of hull (4), warnings that come on sooner, a storm that falls back faster, and calmer effects (no shiver, no storm dots). + +## Sounds + +Orbit Rush has four sounds of its own, made in SoundCraft and part of the kit (`library/rush_*`): + +- **boost:** Blaze's burst +- **slow-mo:** Drift's ability +- **portal:** going through the 999 portal +- **region:** entering a new region + +Kit sounds are used for the rest: a star, a smash, a knock, a power-up picked up and switched on, the ability charged, and OK with nothing ready. + +## Readability, Reduce motion and Reduce flashing + +- **Rising and diving:** the shadow, the size, the eased height and the coloured ▲▼ marker are as in 312. +- **Speed Burst:** draws streaks, except with Reduce motion. +- **Slow-mo:** tints the screen cool blue. +- **Warp Ahead:** a soft pink fade, fainter with Reduce flashing. + +## Tests (RushSimTest, 11 tests) + +- **Every region × every difficulty × every pilot:** 90 s each from the region's start, the pilot using their ability whenever it's ready. A careful bot with a quarter-second reaction takes no hits. The bot presses ▲ or ▼ again when an earlier rise or dive would run out, as a player would. +- **Regions:** they come in order, the portal turns up, and the secret route has no hazards, only stars, plus the 999 bonus. +- **Abilities and power-ups:** each ability does what it says, and each power-up works. +- **Gentle:** 4 hull, earlier warnings, and one hazard a row even in The Static Zone. +- **No allocation:** 20,000 ticks across pilots, abilities, power-ups and the secret route allocated 0 bytes. +- **Fit:** the pilot labels, Play buttons, region banners and HUD lines all fit.