Asteroid Fling
A fast-paced, 2D arcade space platformer built around zero-gravity momentum, orbital physics, and precision slingshot mechanics.
Project Overview
Asteroid Fling is a minimalist 2D arcade game built in Unity using C#. The core objective is simple: navigate zero-gravity planetary obstacle courses, avoid hazardous out-of-bounds boundaries, and reach the exit portal as quickly as possible.
Instead of traditional platforming controls like running or jumping, movement in Asteroid Fling relies entirely on gravitational forces and momentum. Players interact with the environment using a single primary input—Left Click to Grapple—attaching to nearby celestial "Pull Stars" to whip around them in orbit and catapult across space.
Key Mechanics & Systems
-
One-Button Grapple Controls
Left-clicking hooks onto the nearest Pull Star within range. The grapple automatically calculates radial spring forces and centripetal acceleration to lock the player into a stable orbit, granting an instantaneous velocity boost upon release.
-
Gravitational Swirl Fields
Planets act as circular vortex force fields. Applying a combination of continuous tangential (sideways) acceleration and radial (inward) attraction, planets dynamically sweep nearby objects—including stationary players, hazard debris, and pull stars—into rotational orbits.
-
Fatal Viewport Boundaries
To maintain high arcade stakes, camera boundaries are strictly enforced. Exiting the static camera view instantly triggers player death, complete with screen-shake feedback, spatialized sound effects, and level reloading.
-
Event-Driven Architecture & Audio Juice
Built on a decoupled Pub/Sub
EventBusarchitecture. A persistent singletonAudioManagerlistens for gameplay events to trigger randomized grapple pitch effects, seamless cross-scene background music, and dynamic looping orbital sound effects.
Development Iterations & Challenges
Designing a game reliant almost entirely on physics required constant iteration, mathematical fine-tuning, and playtesting feedback:
1. Redesigning Planet Gravity
Early versions of planet gravity relied on manually rotating velocity vectors. However, if a player came to a complete stop next to a planet, nothing happened because zero velocity rotated into zero velocity. I reworked planets to apply continuous physics forces (Rigidbody2D.AddForce with ForceMode2D.Acceleration), combining tangential swirl vectors with centripetal inward pull. This allowed stationary objects to automatically get swept up into orbit while ensuring objects of any mass orbited at uniform speeds.
2. Balancing Newtonian Inertia vs. Player Control
I initially tried to lean into more physically accurate zero-gravity behavior, but playtesting quickly showed that strict Newtonian motion was not actually fun. Without damping or intentional control limits, players could build up absurd speeds across repeated grapple chains, making the game feel chaotic and less readable than it should. Instead of forcing realism, I tuned the movement toward an arcade-friendly compromise: the level still feels floaty and spacey, but with soft speed capping, radial spring-dampers, and more deliberate momentum control so each slingshot remains readable, skillful, and satisfying to play.
3. Enforcing Multi-Resolution Aspect Ratios
Because level layout and fatal boundaries depend on camera viewports, testing across different monitor resolutions initially broke game balance. Standard Canvas UI elements also leaked over letterbox regions during scene reloads. I resolved this by building a custom viewport script with a dedicated background depth-camera to lock the viewport to a strict 16:9 aspect ratio across all screen resolutions without UI visual artifacts.
4. Audio State Management across Scene Reloads
Handling looping sound effects (like the planet orbital hum) created edge-case bugs where sounds continued playing post-death because scene reloads bypassed standard trigger-exit events. Subscribing audio counters directly to Unity's SceneManager.sceneLoaded callbacks guaranteed all physics state flags clean up cleanly on restarts.
Play the Game
Experience the momentum-based slingshot mechanics of Asteroid Fling yourself!
Posted by: Aidan Vidal
Posted on: October 18, 2026