<?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: iloveferrets</title>
    <description>The latest articles on DEV Community by iloveferrets (@marco_polo).</description>
    <link>https://dev.to/marco_polo</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%2F3052120%2F5c2a7b1e-28c5-48e4-8de8-314b924864dc.png</url>
      <title>DEV Community: iloveferrets</title>
      <link>https://dev.to/marco_polo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marco_polo"/>
    <language>en</language>
    <item>
      <title>My first game</title>
      <dc:creator>iloveferrets</dc:creator>
      <pubDate>Tue, 15 Apr 2025 09:49:11 +0000</pubDate>
      <link>https://dev.to/marco_polo/my-first-game-1n9f</link>
      <guid>https://dev.to/marco_polo/my-first-game-1n9f</guid>
      <description>&lt;h1&gt;
  
  
  My First Web Game — How I Built a Flag Quiz with Angular (and What I Learned)
&lt;/h1&gt;

&lt;p&gt;It all started with a random idea: &lt;em&gt;could I build a small game using only Angular?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'm currently a UX/UI design student, but I've been getting more and more into frontend development — especially with Angular. While most tutorials focus on CRUD apps or dashboards, I wanted to create something that felt a bit more fun and interactive. Something I could share with friends and say: "Hey, I made this!"&lt;/p&gt;

&lt;p&gt;That’s how I ended up building my first little web game: a &lt;strong&gt;flag quiz&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 The concept: minimal, fast, fun
&lt;/h2&gt;

&lt;p&gt;The idea was simple: show a flag, let the user choose the correct country from four options, and give immediate feedback.&lt;/p&gt;

&lt;p&gt;My goals were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make it fast and responsive (mobile-friendly too)&lt;/li&gt;
&lt;li&gt;Randomize questions every round&lt;/li&gt;
&lt;li&gt;Keep track of the score&lt;/li&gt;
&lt;li&gt;Add animations for smoother transitions&lt;/li&gt;
&lt;li&gt;Keep it fully frontend — no backend for now&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I sketched a quick wireframe and started breaking the UI down into components.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Building it with Angular
&lt;/h2&gt;

&lt;p&gt;I created a new Angular app with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng new flag-quiz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I made a &lt;code&gt;FlagService&lt;/code&gt; to handle core logic — loading a static list of countries, shuffling flags, and preparing randomized answers.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;Country&lt;/code&gt; interface looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Country&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flagUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;QuizComponent&lt;/code&gt; subscribes to the current flag and options. When a user selects an answer, it checks correctness, shows feedback, and after a short delay, moves to the next flag.&lt;/p&gt;

&lt;p&gt;I used Angular’s built-in tools for routing, component state, and animations via &lt;code&gt;@angular/animations&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 Styling and user experience
&lt;/h2&gt;

&lt;p&gt;I wanted the game to feel clean and satisfying. No flashy UI, just simple and smooth.&lt;/p&gt;

&lt;p&gt;A few things I focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feedback on selection&lt;/strong&gt;: correct/incorrect classes and short delay&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsive layout&lt;/strong&gt;: works well on mobile with &lt;code&gt;flex&lt;/code&gt; and &lt;code&gt;grid&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subtle transitions&lt;/strong&gt;: fading flags in/out between questions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessible UI&lt;/strong&gt;: big buttons, color contrast, keyboard-friendly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I used only vanilla CSS with variables and custom properties to keep things lightweight.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Challenges &amp;amp; lessons learned
&lt;/h2&gt;

&lt;p&gt;Some things I ran into along the way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coordinating &lt;code&gt;*ngIf&lt;/code&gt; with animations was tricky — I had to delay hiding/showing content&lt;/li&gt;
&lt;li&gt;Keeping logic inside the service made the component much easier to manage&lt;/li&gt;
&lt;li&gt;It’s easy to overthink state management — simple flags and booleans worked just fine here&lt;/li&gt;
&lt;li&gt;Even a tiny game benefits &lt;strong&gt;a lot&lt;/strong&gt; from polish like sound effects or feedback&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Try the game!
&lt;/h2&gt;

&lt;p&gt;I deployed the game using Firebase Hosting with one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ng deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it worked like a charm.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Play it here&lt;/strong&gt;: &lt;a href="https://quizbandiere.it" rel="noopener noreferrer"&gt;https://quizbandiere.it&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;(No login, no ads — just a 2-minute geography challenge!)&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 What’s next?
&lt;/h2&gt;

&lt;p&gt;There’s a lot more I’d like to explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding difficulty levels (e.g., just Europe or Africa)&lt;/li&gt;
&lt;li&gt;A timer and leaderboard&lt;/li&gt;
&lt;li&gt;Multilingual labels&lt;/li&gt;
&lt;li&gt;Dark mode (why not?)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for now, I’m just happy I made it. This was a super fun way to apply Angular outside the typical use case.&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 Let’s chat!
&lt;/h2&gt;

&lt;p&gt;Have you ever made a game in Angular (or any frontend framework)?&lt;br&gt;&lt;br&gt;
Got tips or ideas for improvement?&lt;br&gt;&lt;br&gt;
Drop them in the comments — I'd love to hear them!&lt;/p&gt;




&lt;p&gt;Thanks for reading 🙌&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
