Coin Dash Project Story

Inspiration

Coin Dash was inspired by the tactile pleasure of classic tabletop physics games, combined with the digital vocabulary of modern social feeds. We wanted to recreate the physical satisfying friction, rebounds, and tactical depth of games like Carrom, Crokinole, and Shuffleboard in a digital space. Instead of just tapping buttons, we wondered what it would be like if social thread interactions were represented physically: players literally "strike" upvote coins onto a digital forum board. The closer your coin rests to the hot center of the thread, the more upvote points it gathers, while knocking opponent coins out of scoring circles represents a physical "downvote".

What it does

Coin Dash is a competitive, physics-based coin-shooting game themed around Reddit communities and daily board modifiers. Players take turns aiming and launching upvote coins across dynamic boards. The game features:

  • Concentric Board Scoring: In Classic Mode, a coin at position $\mathbf{p} = (x, y)$ scores points based on its Euclidean distance $d$ to the board center $\mathbf{c} = (x_c, y_c)$: $$d = \sqrt{(x - x_c)^2 + (y - y_c)^2}$$ The scoring $S(d)$ follows the piecewise model: $$S(d) = \begin{cases} 100 & \text{if } d \le 70 \ 50 & \text{if } 70 < d \le 140 \ 25 & \text{if } 140 < d \le 220 \ 10 & \text{if } 220 < d \le 300 \ 0 & \text{if } d > 300 \end{cases}$$
  • Comment Arena Mode: Scores points by landing coins inside floating, dynamic comment card boxes, simulating a live discussion thread.
  • Vector Reflections: Coins bounce off circular boundaries using an elastic velocity vector reflection model: $$\mathbf{v}' = e \cdot \left(\mathbf{v} - 2(\mathbf{v} \cdot \mathbf{n})\mathbf{n}\right)$$ where $\mathbf{n}$ is the unit normal vector pointing to the board center, $\mathbf{v}$ is the incident velocity, and $e$ is the restitution coefficient. ## How we built it We built the application as a modern single-page game using Vite and Phaser 3, utilizing Matter.js for high-fidelity rigid body physics simulation. The architecture is modular:
  • Game.js configures the scale manager and canvas renderer.
  • PhysicsManager.js coordinates collision callbacks, boundary reflections, and active forces.
  • ScoreManager.js calculates live points, multiplier awards (5x for Golden Coins), and trickshot bonuses.
  • Board.js renders the vector graphics for the concentric target board and the comment cards.
  • AimController.js manages trajectory calculations and user drag input. We modeled air resistance drag continuously so that coins naturally slow down, described by the differential equation $\frac{d\mathbf{v}}{dt} = -c_d \mathbf{v}$, yielding an exponential velocity decay: $$\mathbf{v}(t) = \mathbf{v}_0 e^{-c_d t}$$ ## Challenges we ran into
  • Matter.js Coin Merging: During high-impact collisions, Matter.js would occasionally fail to resolve overlaps fast enough, causing coins to stick together. We solved this by writing a custom displacement calculation to manually push overlapping bodies apart by half their overlap distance along their collision normal.
  • Super-Elastic Velocity Spikes: In the high-bounce r/funny mode where restitution $e = 1.08 > 1$, compounding rebounds would occasionally cause a coin's speed to run away exponentially. We solved this by applying a hard velocity vector magnitude limit: $|\mathbf{v}| \le v_{\text{max}}$.
  • Device Viewport Fitting: Adapting a vertical-scrolling $1080 \times 1920$ game layout to diverse screen sizes. We combined Phaser's SCALE.FIT engine with an absolute-centered HTML outer wrapper. ## Accomplishments that we're proud of
  • Tactile Gameplay Feel: The visual feedback loops (camera shakes, particle sparks, expanding ripples, squashing and stretching emojis) give the game a satisfying feel.
  • Chaos Events Integration: Successfully implementing real-time environmental forces like Magnet Pull ($\mathbf{F}{\text{magnet}} = 0.00035 \cdot \mathbf{n}$) and directional Wind ($\mathbf{F}{\text{wind}}$) that alter the coin paths in real-time.
  • Reddit Thematic Cohesion: Seamlessly translating online community tropes into actual gameplay elements (e.g. Upvote Rings, Comment Cards, Moderator bots). ## What we learned
  • Matter.js Force Vectoring: We learned how to manipulate body speed, friction coefficients, and continuous impulses to simulate fluid board-game friction rather than arcade physics.
  • Visual Polish ("Juice"): Even mathematically perfect physics simulations feel static without micro-animations. Particle effects, bounce animations, and floating score texts completely transform the player's engagement. ## What's next for Coin Dash
  • Real-time Online Matchmaking: Transitioning from local hotseat play to real-time online matchmaking using WebSockets.
  • Subreddit Expansion:
    • r/science: Low-gravity mode simulating orbital physics.
    • r/mildlyinteresting: Randomly spawned obstacle hazards on the board.
  • Collectible Custom Coins: Enabling unlocks for custom coin skins and trail particle cosmetics based on high score milestones.

Built With

Share this project:

Updates

Submission history