<?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: Sujal Burnwal</title>
    <description>The latest articles on DEV Community by Sujal Burnwal (@sujal_b07).</description>
    <link>https://dev.to/sujal_b07</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3293325%2F0b70c736-d009-44a0-96a5-f89f5d8355b7.webp</url>
      <title>DEV Community: Sujal Burnwal</title>
      <link>https://dev.to/sujal_b07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sujal_b07"/>
    <language>en</language>
    <item>
      <title>🎮 Building a Counter-Strike-Inspired FPS Game in the Browser Using Amazon Q (On Windows)</title>
      <dc:creator>Sujal Burnwal</dc:creator>
      <pubDate>Wed, 25 Jun 2025 11:37:00 +0000</pubDate>
      <link>https://dev.to/sujal_b07/building-a-counter-strike-inspired-fps-game-in-the-browser-using-amazon-q-on-windows-3dma</link>
      <guid>https://dev.to/sujal_b07/building-a-counter-strike-inspired-fps-game-in-the-browser-using-amazon-q-on-windows-3dma</guid>
      <description>&lt;p&gt;&lt;strong&gt;I created a working 3D first-person shooter game inside the browser — using only prompts with Amazon Q, JavaScript, and Three.js.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Overview
&lt;/h2&gt;

&lt;p&gt;As part of the &lt;strong&gt;Build Games with Amazon Q CLI challenge&lt;/strong&gt;, I set out to build a &lt;strong&gt;3D browser FPS game&lt;/strong&gt; inspired by &lt;strong&gt;Counter-Strike&lt;/strong&gt;, entirely on &lt;strong&gt;Windows 11&lt;/strong&gt;, using &lt;strong&gt;Amazon Q in VS Code&lt;/strong&gt; as my development assistant.&lt;/p&gt;

&lt;p&gt;I didn’t manually write most of the code. Instead, I relied on &lt;strong&gt;conversational prompts to Amazon Q&lt;/strong&gt;, and it handled the logic, visuals, and structure — powered by &lt;strong&gt;Three.js&lt;/strong&gt;, &lt;strong&gt;Vite&lt;/strong&gt;, and &lt;strong&gt;Vanilla JavaScript&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧰 Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;💻 Windows 11
&lt;/li&gt;
&lt;li&gt;🧠 Amazon Q (VS Code Extension)
&lt;/li&gt;
&lt;li&gt;⚙️ Node.js + Vite
&lt;/li&gt;
&lt;li&gt;🧱 HTML, CSS, and JavaScript
&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Three.js&lt;/strong&gt; for 3D graphics
&lt;/li&gt;
&lt;li&gt;🎮 No game engine — just the browser and AI&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💬 Amazon Q Prompts I Used (For the 3D Game)
&lt;/h2&gt;

&lt;p&gt;These are the &lt;strong&gt;exact prompts&lt;/strong&gt; I gave to Amazon Q to generate the entire game step-by-step:&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣ Project Setup with Vite
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I want to build a 3D browser FPS game like Counter-Strike using JavaScript and Three.js in a Vite project. Give me index.html, main.js, and style.css to start.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Q provided the entire starter setup. I scaffolded the Vite project and installed Three.js using:&lt;br&gt;
&lt;code&gt;npm install three&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2️⃣ Set Up the Scene, Camera &amp;amp; Lighting&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a 3D scene using Three.js with a PerspectiveCamera, ambient light, and directional light. Add a floor using PlaneGeometry and basic background color.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scene created&lt;/li&gt;
&lt;li&gt;Lighting added&lt;/li&gt;
&lt;li&gt;Camera positioned&lt;/li&gt;
&lt;li&gt;Floor placed&lt;/li&gt;
&lt;li&gt;Render loop running&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3️⃣ Add Player Controls (WASD + Mouse Look)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add FPS-style controls using PointerLockControls from Three.js. Enable WASD movement and mouse-based look direction.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ I could now move and look around just like in a typical FPS.&lt;/p&gt;

&lt;p&gt;4️⃣ Add a Gun in Front of the Camera&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add a simple gun model (like a BoxGeometry) attached to the camera so it stays in view as the player moves.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Now it looked like I was holding a weapon — even though it was basic, it was effective.&lt;/p&gt;

&lt;p&gt;5️⃣ Enable Shooting Bullets&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create bullets when the mouse is clicked. Use raycasting to shoot in the direction the player is looking. Destroy bullet after hitting an enemy or after a few seconds.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Q added a bullets array, movement logic, and raycasting hit detection.&lt;/p&gt;

&lt;p&gt;6️⃣ Add Enemies That Move Toward the Player&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add enemy boxes that spawn at random X/Z positions and move toward the player. If they reach the player, reduce health.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Enemy movement worked using vector math, and enemies were deleted when they reached the player or got shot.&lt;/p&gt;

&lt;p&gt;7️⃣ Handle Bullet-Enemy Collision&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When a bullet hits an enemy, remove the enemy and increase the player’s score.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Collision detection was refined using bounding boxes + raycasting.&lt;/p&gt;

&lt;p&gt;8️⃣ Add Health and Score UI&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Display the player's current health and score on the screen using DOM overlays.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ I added a fixed-position div on top of the canvas showing:&lt;/p&gt;

&lt;p&gt;❤️ Health: 100&lt;br&gt;
🎯 Score: 0&lt;/p&gt;

&lt;p&gt;9️⃣ Add Game Over State and Restart Option&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When health reaches 0, stop the game loop, show “Game Over” text and a restart button.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Q froze the animation loop and displayed a styled overlay. I added a restart option on keypress (R).&lt;/p&gt;

&lt;p&gt;🧪 Debugging &amp;amp; Tweaking with Q&lt;br&gt;
Whenever something didn’t feel right, I just asked Q:&lt;/p&gt;

&lt;p&gt;❌ Enemies too fast?&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Reduce enemy speed by half.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;❌ Camera clipping through objects?&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Fix camera so it doesn’t clip through objects.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;❌ Bullets not visible?&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Make bullets visible with yellow color and Trail effect.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;❌ Game lagging?&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Optimize game loop for fewer object updates per frame.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This was hands-down the smoothest development workflow I’ve ever experienced.&lt;/p&gt;

&lt;p&gt;📸 Screenshots&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5irq3ej5omieuknu388b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5irq3ej5omieuknu388b.png" alt="Image description" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Glimpse of the game&lt;br&gt;
&lt;a href="https://youtu.be/EsIlsrxNA-8" rel="noopener noreferrer"&gt;https://youtu.be/EsIlsrxNA-8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚀 What's Next?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I’m planning to extend the game by asking Q to:&lt;/li&gt;
&lt;li&gt;Add background sound and gunfire effects&lt;/li&gt;
&lt;li&gt;Spawn multiple enemy types&lt;/li&gt;
&lt;li&gt;Use textures for realism&lt;/li&gt;
&lt;li&gt;Add a level system with increasing difficulty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🗣️ Final Thoughts&lt;br&gt;
“I didn’t write this game alone — I built it side-by-side with an AI. Amazon Q didn’t just give me code. It taught me how to build.”&lt;/p&gt;

&lt;p&gt;This challenge was proof that you don’t need years of game dev experience.&lt;br&gt;
You just need a clear idea and the right prompts.&lt;/p&gt;

</description>
      <category>amazonqcli</category>
      <category>webdev</category>
      <category>ai</category>
      <category>gamechallenge</category>
    </item>
  </channel>
</rss>
