<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: WebRizen</title>
    <description>The latest articles on DEV Community by WebRizen (@webrizen).</description>
    <link>https://dev.to/webrizen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3714184%2F76252142-f56f-49bf-939f-356fc0cba483.png</url>
      <title>DEV Community: WebRizen</title>
      <link>https://dev.to/webrizen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/webrizen"/>
    <language>en</language>
    <item>
      <title>Spinweb: An AI-Powered, Physics-Driven Beyblade Web Game 🌪️</title>
      <dc:creator>WebRizen</dc:creator>
      <pubDate>Sun, 12 Jul 2026 04:55:54 +0000</pubDate>
      <link>https://dev.to/webrizen/spinweb-an-ai-powered-physics-driven-beyblade-web-game-2248</link>
      <guid>https://dev.to/webrizen/spinweb-an-ai-powered-physics-driven-beyblade-web-game-2248</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;For this weekend's challenge, we were prompted to "build something inspired by passion". The prompt highlighted that passion can be seen in "the rivalry that pushes competitors to greatness" and the "devotion fans pour into their teams, their fandoms, their crafts". &lt;/p&gt;

&lt;p&gt;To capture this intense spirit of rivalry and fandom, I built &lt;strong&gt;Spinweb&lt;/strong&gt;-a fast-paced, 2D physics-based spinning top battler inspired by the passionate clashes of Beyblade. &lt;/p&gt;

&lt;p&gt;In Spinweb, players choose their arena and their battle style (Attack, Defense, or Stamina), slingshot their top into a high-stakes basin, and actively battle a dynamically adapting AI opponent. To truly capture the anime-style rivalry, the game uses AI to dynamically generate aggressive trash-talk before the match and hype esports-style commentary after the clash!&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://spinweb.vercel.app/" rel="noopener noreferrer"&gt;Play Spinweb Here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/aymJd0zJlq0"&gt;
  &lt;/iframe&gt;
.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Webrizen" rel="noopener noreferrer"&gt;
        Webrizen
      &lt;/a&gt; / &lt;a href="https://github.com/Webrizen/spinweb" rel="noopener noreferrer"&gt;
        spinweb
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A 2D physics-based spinning top battler with retro pixel-art aesthetics. Launch, clash, and outlast your opponent!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Spinweb — Physics-Based Spinning Top Battler&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Spinweb&lt;/strong&gt; is a 2D side-view, physics-based spinning top battler with a retro pixel-art aesthetic. Built using &lt;strong&gt;Phaser 3&lt;/strong&gt; and &lt;strong&gt;Matter.js&lt;/strong&gt;, the game integrates the &lt;strong&gt;Google Gemini API&lt;/strong&gt; to generate real-time, context-aware pre-match rivalry trash-talk and post-match esports commentaries.&lt;/p&gt;
&lt;p&gt;Developed for the &lt;strong&gt;DEV.to Weekend Challenge: Passion Edition&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📸 Game Previews&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/Webrizen/spinweb/public/preview-1.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FWebrizen%2Fspinweb%2FHEAD%2Fpublic%2Fpreview-1.png" width="48%" alt="Spinweb Selection Screen"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/Webrizen/spinweb/public/preview-2.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FWebrizen%2Fspinweb%2FHEAD%2Fpublic%2Fpreview-2.png" width="48%" alt="Circular Stadium Battle"&gt;&lt;/a&gt;
  &lt;br&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/Webrizen/spinweb/public/preview-3.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FWebrizen%2Fspinweb%2FHEAD%2Fpublic%2Fpreview-3.png" width="48%" alt="Rectangular Grid Combat"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/Webrizen/spinweb/public/preview-4.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FWebrizen%2Fspinweb%2FHEAD%2Fpublic%2Fpreview-4.png" width="48%" alt="Post Match Commentary Analysis"&gt;&lt;/a&gt;
&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📖 Table of Contents&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-game-overview" rel="noopener noreferrer"&gt;Game Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-how-the-passion-theme-is-captured" rel="noopener noreferrer"&gt;How the Passion Theme is Captured&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-core-features" rel="noopener noreferrer"&gt;Core Features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-physics--mathematical-model" rel="noopener noreferrer"&gt;Physics &amp;amp; Mathematical Model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-google-ai--gemini-integration" rel="noopener noreferrer"&gt;Google AI &amp;amp; Gemini Integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-tech-stack" rel="noopener noreferrer"&gt;Tech Stack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-installation--running" rel="noopener noreferrer"&gt;Installation &amp;amp; Running&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-tuning-constants" rel="noopener noreferrer"&gt;Tuning Constants&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Webrizen/spinweb#-credits" rel="noopener noreferrer"&gt;Credits&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎮 Game Overview&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;In Spinweb, players choose their arena and select a signature Beyblade-style behavior (Attack, Defense, or Stamina). Once selected, players release their slingshot launch vectors to shoot their tops into a high-speed clashing stadium, jockeying for center control and avoiding Ring Outs and Sleep Outs using real-time keyboard inputs.&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🔥 How the Passion Theme is Captured&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;Spinweb captures the &lt;strong&gt;Passion&lt;/strong&gt;…&lt;/p&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Webrizen/spinweb" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I built Spinweb over the weekend using &lt;strong&gt;Phaser 3&lt;/strong&gt;, &lt;strong&gt;Matter.js&lt;/strong&gt;, and &lt;strong&gt;Vite&lt;/strong&gt;. Building a high-impact spinning battler required some deep physics hacking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The Gravity Well Arena:&lt;/strong&gt; To simulate a 3D Beystadium (a shallow basin) within a 2D HTML5 Canvas, I disabled standard world gravity. Instead, I applied a constant "gravity well" vector force that constantly pulls both tops toward the absolute center of the arena. This ensures continuous, high-speed pendulum-like clashes.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Gyroscopic Physics:&lt;/strong&gt; Using Matter.js, I mapped the &lt;code&gt;angularVelocity&lt;/code&gt; (spin speed) to a stamina bar. Collisions dynamically calculate tangential velocity and transfer kinetic energy into linear knockback force (clash drain). This means faster-spinning tops hit harder and resist being knocked out of the ring!&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Active Controls &amp;amp; AI:&lt;/strong&gt; Players can use WASD/Arrows to dodge or strike during the clash. The AI opponent dynamically assigns itself a style on load and changes its behavior—Attack AI will chase you, Defense AI will tank the center, and Stamina AI will ride the edges to avoid contact.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Integrating the Partner Technologies:&lt;/strong&gt;&lt;br&gt;
The official challenge rules note that participants may use multiple technologies in a single submission to qualify for multiple prize categories. I utilized two of them to elevate the game's presentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Google AI (Gemini 1.5 Flash):&lt;/strong&gt; I used the Google Generative AI SDK to breathe life into the rivalry. Before a match, the game sends the player's and enemy's chosen combat styles to Gemini to generate a context-aware, dramatic line of "trash-talk" (e.g., &lt;em&gt;"Your reckless attacks will shatter against my iron wall!"&lt;/em&gt;). After the match, the win condition and match duration are sent to Gemini to generate an energetic, esports-style post-match commentary summarizing the fight.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;ElevenLabs:&lt;/strong&gt; To give the game a cinematic, anime-style feel, I utilized ElevenLabs to generate premium, dramatic announcer voiceovers (like a booming "Let it rip!") that trigger during the launch and Game Over states. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;I am submitting this project for the following prize categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Best Use of Google AI&lt;/strong&gt; (For the dynamic Gemini-powered rivalry trash-talk and post-match esports analysis).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Best Use of ElevenLabs&lt;/strong&gt; (For the pre-generated cinematic announcer voiceovers).&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>gamedev</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
