<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Typing Game]]></title><description><![CDATA[Typing Game]]></description><link>https://typinggame.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 00:18:48 GMT</lastBuildDate><atom:link href="https://typinggame.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I Built an Open Online Typing Game Platform with Real-Time 1v1 Multiplayer in React]]></title><description><![CDATA[Over the past few months, I set out to build TypingGame.in — an interactive, completely free online typing academy and arcade game portal. While platforms…]]></description><link>https://typinggame.hashnode.dev/about-typinggame</link><guid isPermaLink="true">https://typinggame.hashnode.dev/about-typinggame</guid><category><![CDATA[How I Built a Real-Time 1v1 Multiplayer Typing Game]]></category><category><![CDATA[typing]]></category><category><![CDATA[typing speed]]></category><category><![CDATA[typing test]]></category><category><![CDATA[#typing game online]]></category><category><![CDATA[typing game]]></category><dc:creator><![CDATA[Typing Game]]></dc:creator><pubDate>Tue, 24 Nov 2026 10:01:52 GMT</pubDate><content:encoded><![CDATA[<p>Over the past few months, I set out to build <a href="https://typinggame.in/">TypingGame.in</a> — an interactive, completely free online typing academy and arcade game portal.</p>
<p>While platforms like Monkeytype and TypeRacer dominate the market, I wanted to build something that blended <strong>educational touch-typing curriculums</strong>, <strong>real-time 1v1 PvP racing</strong>, and <strong>arcade gameplay</strong> (car racing, bubble popping, and zombie defense) into a single cohesive web application.</p>
<p>Here is a breakdown of how the architecture works, how WPM is calculated accurately, and how real-time 1v1 sync is handled.</p>
<hr />
<h2>1. Calculating Standardized WPM &amp; Accuracy in Real-Time</h2>
<p>A common issue in novice typing tests is treating each space-separated word as a single unit. In professional and government certification standards (such as SSC CGL and RRB), typing speed is universally standardized to <strong>5 keystrokes = 1 standard word</strong>.</p>
<p>Here is the exact formula implemented in the speed test engine:</p>
<p>$$\text{Gross WPM} = \frac{\text{Total Characters Typed} / 5}{\text{Time Elapsed in Minutes}}$$</p>
<p>$$\text{Net WPM} = \max\left(0, \frac{\text{Correct Characters} / 5}{\text{Time Elapsed in Minutes}}\right)$$</p>
<p>$$\text{Accuracy %} = \left(\frac{\text{Correct Characters}}{\text{Total Characters Typed}}\right) \times 100$$</p>
<p>By evaluating velocity against <code>Date.now()</code> timestamps rather than relying on <code>setInterval</code> tick counts, the speedometer remains immune to browser background throttling or tab switches.</p>
<hr />
<h2>2. Dual-Engine Architecture: Desktop Keyboard vs. Mobile Virtual Keyboards</h2>
<p>One of the trickiest challenges when building an interactive <a href="https://typinggame.in/">typing game online</a> is handling smartphone virtual keyboards (like Android Gboard or iOS Safari).</p>
<p>On desktop keyboards, pressing any key fires a standard <code>KeyboardEvent</code> with <code>e.key.length === 1</code>. On mobile devices, however, virtual keyboards use Input Method Editors (IME) with predictive composition, which often emit <code>e.key = 'Unidentified'</code> and <code>keyCode: 229</code>.</p>
<p>To support both seamlessly:</p>
<ul>
<li>We track keystrokes via direct input interception overlaying the paragraph stage.</li>
<li>If a desktop single-character <code>keydown</code> fires, sound effects and velocity update immediately.</li>
<li>If a mobile virtual keyboard inserts characters via <code>input</code> / <code>onChange</code>, the engine compares the delta between <code>userInput</code> and <code>targetText</code> on the fly, starting the wall-clock timer automatically.</li>
</ul>
<p>You can try the live test on mobile or desktop at <a href="https://typinggame.in/typing-test">TypingGame.in Speed Test</a>.</p>
<hr />
<h2>3. Real-Time 1v1 Multiplayer Racing</h2>
<p>For the competitive arena at <a href="https://typinggame.in/multiplayer">TypingGame.in/multiplayer</a>, players can generate a 6-digit room code and race side-by-side.</p>
<p>Every keystroke emits a lightweight telemetry payload:</p>
<ul>
<li>Current character index</li>
<li>Live WPM</li>
<li>Accuracy percentage</li>
<li>Progress completion ratio</li>
</ul>
<p>A lightweight WebSocket relay synchronizes player cars on the track with interpolation, providing that nail-biting arcade racing sensation without heavy server overhead.</p>
<hr />
<h2>4. Lessons Learned &amp; What's Next</h2>
<ol>
<li><strong>Pre-rendering matters</strong>: Static pre-rendering of 250 routes allowed the site to load in under 500ms with 0 Cumulative Layout Shift (CLS).</li>
<li><strong>Accessible inputs</strong>: Transparent focus interception provides a distraction-free experience while preserving native screen reader support.</li>
</ol>
<p>Feel free to play a few rounds on <a href="https://typinggame.in/">TypingGame.in</a> and share your fastest WPM score! If you have suggestions or questions about the architecture, let's discuss in the comments below!</p>
]]></content:encoded></item></channel></rss>