<?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" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Noahdecoco]]></title><description><![CDATA[Stories from a software developer]]></description><link>https://blog.noahdecoco.com/</link><image><url>http://blog.noahdecoco.com/favicon.png</url><title>Noahdecoco</title><link>https://blog.noahdecoco.com/</link></image><generator>Ghost 2.36</generator><lastBuildDate>Thu, 19 Feb 2026 09:23:31 GMT</lastBuildDate><atom:link href="https://blog.noahdecoco.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Semantics and naming conventions]]></title><description><![CDATA[<!--kg-card-begin: image--><figure class="kg-card kg-image-card"><img src="https://blog.noahdecoco.com/content/images/2020/12/image.png" class="kg-image"></figure><!--kg-card-end: image--><blockquote>"What's in a name? That which we call a rose by any other name would smell as sweet!" ~ Shakespeare's Romeo</blockquote><p>OK, Romeo... all might be fair in love and war but when it comes to writing good code, it's called semantics. It surprises me how so many developers ignore proper</p>]]></description><link>https://blog.noahdecoco.com/html-semantics/</link><guid isPermaLink="false">5fd65651ac89417130a4a8c7</guid><category><![CDATA[semantics]]></category><category><![CDATA[naming conventions]]></category><category><![CDATA[clean code]]></category><category><![CDATA[empathy]]></category><dc:creator><![CDATA[Noah Fernandes]]></dc:creator><pubDate>Thu, 17 Dec 2020 09:37:14 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: image--><figure class="kg-card kg-image-card"><img src="https://blog.noahdecoco.com/content/images/2020/12/image.png" class="kg-image"></figure><!--kg-card-end: image--><blockquote>"What's in a name? That which we call a rose by any other name would smell as sweet!" ~ Shakespeare's Romeo</blockquote><p>OK, Romeo... all might be fair in love and war but when it comes to writing good code, it's called semantics. It surprises me how so many developers ignore proper semantics when writing code. Sometimes, it's because of laziness but mostly I find it's because of ignorance and a lack of empathy for the next developer who has to work with their code. I'm not innocent either, I too was once a programmer who didn't understand the value of good semantics. Luckily, I was fortunate to work alongside some good lead developers who opened my eyes to the value of well written code.</p><p>As I advance in my career, I now mentor junior developers and help guide them on their way to becoming better front-end programmers. And semantics is a foundation often over looked, but very important in the life of a long running product.</p><p>Let's take HTML as an example, if you need to wrap a button label in an element, use a <code>&lt;span /&gt;</code>, not a <code>&lt;p /&gt;</code>. Instead of writing a list using a bunch of meaningless <code>&lt;div /&gt;</code> tags, consider if the list is ordered or unordered and use a <code>&lt;ol /&gt;</code> or <code>&lt;ul /&gt;</code>. Use a <code>&lt;button /&gt;</code> when you want to perform an action such as opening a modal or submitting a form, and a <code>&lt;a /&gt;</code> when the goal is to navigate to a url.</p><p>There is a reason those tags were designed. Browsers and Readers use those tags to understand content heirachy and context. A really easy way to check if a DOM is built using the right tags, is to disable CSS on the browser. The page should still be clearly legible and the content hierachy easy to understand. Check out this simple code pen demonstration: <a href="https://codepen.io/Noahdecoco/pen/eYdWPRq">https://codepen.io/Noahdecoco/pen/eYdWPRq</a></p><p>I recommend reading this article for more information: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Semantics">https://developer.mozilla.org/en-US/docs/Glossary/Semantics</a></p>]]></content:encoded></item><item><title><![CDATA[Wizard Smash: Global Game Jam 17]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The <a href="http://globalgamejam.org/">Global Game Jam</a> (GGJ) is the world's largest yearly game jam event. It is a challenge for 'game creators' from around the world, to get together and build a game, from scratch, based on a common theme, all is just 48 hours.<br>
Though we didn't officially register with GGJ</p>]]></description><link>https://blog.noahdecoco.com/wizard-smash-global-game-jam-17/</link><guid isPermaLink="false">5da4641458d3873806c22fda</guid><dc:creator><![CDATA[Noah Fernandes]]></dc:creator><pubDate>Thu, 23 Feb 2017 12:03:00 GMT</pubDate><media:content url="https://blog.noahdecoco.com/content/images/2019/10/IMG_5044-1.JPG" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5044-1.JPG" alt="Wizard Smash: Global Game Jam 17"><p>The <a href="http://globalgamejam.org/">Global Game Jam</a> (GGJ) is the world's largest yearly game jam event. It is a challenge for 'game creators' from around the world, to get together and build a game, from scratch, based on a common theme, all is just 48 hours.<br>
Though we didn't officially register with GGJ and sign in at one of their venues, a bunch of us thought it would be fun to take up the challenge from home. So Casper (developer), Daan (artist), Samantha (artist) and I got together and camped out at Casper's to see what we could hash out in one weekend.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5031.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>The brainstorm</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>We started late on a Friday evening and the first (and smartest) thing we did was to finalise our game concept before calling it a night. This year's theme was <em>WAVES</em>. So began the brain storming... a lot of ideas started flying about! Some good, some mediocre, some impossible, but one stuck and evolved into something we felt would be super fun to build and play. And so we came up with..</p>
<p><em><strong>A MULTIPLAYER WIZARD BRAWLER IN OUTTER SPACE!</strong></em></p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5030.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Beautiful, isn't it?</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>Ok, right. I know it doesn't look like much yet, but this is just a quick hashed out paper prototype. But here is what we had after two insane days of work.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/full-game-4.gif" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>The end result</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>In this game, every player is a wizard who must defend their crystal tower, while trying to destroy their opponent's by draining it's energy. If a player's tower is destroyed, it's game over for them. If this sounds easy enough, you'd be right. That's why we created a treacherous and unstable arena of revolving stones and falling platforms. Still easy? Yeah, that's why we added the ominous black hole at the core. Go too close to it and be prepared to be stringified into oblivion.</p>
<p>May the best Wizard win!</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/blue-destroy-green.gif" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Blue turns Green's crystal tower into dust!</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>Besides maneuvering around an unstable platform, the players can do the following three actions: heal their own crystal tower to survive, drain their opponent's crystal tower to defeat them, and use a super power called <em>shock-wave</em> to shove each other of the platform or into the deadly black hole at the core!</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/yellow-blast.gif" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Yellow blasts a helpless Green into the abyss of space</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/yellow-balck-hole.gif" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>A stunned Yellow gets sucked into the black hole</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>We spent a good 48 hours mashing away at our laptops, taking breaks only to sleep or get something to eat (and watch an episode of Rick &amp; Morty). The best part was that even though I only met Daan and Samantha for the first time that weekend (I knew Casper from a previous game jam), we had chemistry and made a great team, keeping each other motivated right to the end.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5045.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Casper getting down with the code</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5044.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Daan and Samantha busy making art</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_5043.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Play testing our game</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>Being my first game jam, I'm proud that I got to make some valuable contributions to it. I programmed the character movement, calculating which platforms they were on and if they were in motion, stable or falling into the depths of nowhere. I also build the <em>shock-wave</em> superpower that blasts each other around. Finally, I also tweaked the variables of the game, calculating the chance and dynamics of the game to make it &quot;feel just right&quot;.</p>
<p>It's always a bit tricky building features that revolve around chance, because it's so subjective. Some find it too fast, other's too slow or too easy, etc. In the end however, with a lot of team play-testing, we struck a good balance making the game not just playable, but fun and addictive.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_0179.JPG" class="kg-image" alt="Wizard Smash: Global Game Jam 17"><figcaption>Game on!</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>If you have Unity and a few compatible XInput controllers, you can grab the source code from <a href="https://github.com/noahdecoco/ggj2017">https://github.com/noahdecoco/ggj2017</a> and play the build yourself. Hard as we worked, there wasn't enough time to implement a menu system, so you have to restart the game in Unity after every battle.</p>
<p>Over that weekend, I documented our progress so that I could put it all in a montage. It's always fun to see the evolution of a project. Hope you enjoy it!</p>
<!--kg-card-end: markdown--><!--kg-card-begin: embed--><figure class="kg-card kg-embed-card"><iframe width="480" height="270" src="https://www.youtube.com/embed/CB9vScNR2HE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure><!--kg-card-end: embed-->]]></content:encoded></item><item><title><![CDATA[Building an Interactive Mirror with Unreal Engine and Microsoft Kinect]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The <a href="https://www.diabetesfonds.nl/home">Diabetes Foundation</a> launched an exhibition in Central Amsterdam to raise awareness about sugar consumption in the Netherlands. But how do we make this a fun experience, one that's engaging with their audience? Their creative agency (<a href="http://lemz.net/">Lemz</a>) proposed an educational interactive mirror that could 'x-ray' your body, test your knowledge</p>]]></description><link>https://blog.noahdecoco.com/building-an-interactive-mirror/</link><guid isPermaLink="false">5da4524a58d3873806c22fab</guid><dc:creator><![CDATA[Noah Fernandes]]></dc:creator><pubDate>Tue, 08 Nov 2016 10:47:00 GMT</pubDate><media:content url="https://blog.noahdecoco.com/content/images/2019/10/zfuxlssap1uc_wd1280.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.noahdecoco.com/content/images/2019/10/zfuxlssap1uc_wd1280.jpg" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><p>The <a href="https://www.diabetesfonds.nl/home">Diabetes Foundation</a> launched an exhibition in Central Amsterdam to raise awareness about sugar consumption in the Netherlands. But how do we make this a fun experience, one that's engaging with their audience? Their creative agency (<a href="http://lemz.net/">Lemz</a>) proposed an educational interactive mirror that could 'x-ray' your body, test your knowledge about sugar levels in foods and highlight the internal organs most affected by sugar and diabetes.<br>
And we at <a href="http://magicbullet.nl/">Magic Bullet</a>, we turned this idea to reality.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/kid-playing-with-interactive-mirror-1.gif" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Kid playing with our interactive mirror</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>The technology behind this magic is Microsoft Kinect + Unreal Engine + one giant screen! Given that I had little experience in Unreal and had to launch this project in 4 weeks, I dove straight into the deep end and learnt on job.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4529-1.JPG" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Learning on the job</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>This intensive crash course I plunged into was a great opportunity. Unreal Engine is something I always wanted to play with but never found the time to, and this project required me to cover a lot of ground including:</p>
<ul>
<li>Lighting</li>
<li>Audio cueing and synching</li>
<li>Camera and Perspective</li>
<li>Materials, Textures and Shading</li>
<li>World and Relative Transformations</li>
<li>Skeletal Meshes, Rigging and Sockets</li>
<li>Trigger Collisions</li>
<li>UI Widgets and Animations</li>
<li>Events, Functions and Macros</li>
<li>Blueprints and a bit of C++</li>
</ul>
<p>It took me a while to get comfortable programming in Blueprints. I'm more of a <em>'code needs to be written'</em> kinda guy, but surprisingly found dragging and connecting nodes to be quite satisfying too. Blueprints made it easy to start playing around in Unreal without having to know C++.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4487-1.JPG" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Blueprints are pretty cool too</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>I used the <a href="http://www.opaque.media/kinect-4-unreal/#about-k4u">Kinect4Unreal</a> plugin by Opaque Media, which made integrating the Kinect with Unreal a breeze. Their team was also very helpful whenever I had questions, a great service specially when considering they give away this plugin for FREE.<br>
I plan to write a tutorial showing how easy it is to animate a skeletal mesh using their plugin, but for now, it's important to know three things:</p>
<ul>
<li>The plugin works with the latest version of Unreal (4.13 at the time of writing this)</li>
<li>Use the Kinect Interface component (rather than the Kinect Player Controller thats deprecated)</li>
<li>Unfortunately, the 'mirror' option for the meshes doesn't work out of the box and requires a lot of manual joint rotation tweaking, but giving the skeletal mesh a -1 on the y-scale is an easy solution to this issue</li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4535-1.JPG" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Clients doing a final test before launch</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4540-1.jpg" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Setting up the exhibition</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4541-1.jpg" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>It's got to have laser perfection</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4565-1.JPG" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Panoramic view of the exhibition</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>The exhibit was covered by the media on several websites and TV channels like <a href="http://www.rtlxl.nl/?_ga=1.105249475.1172572726.1419782384#!/rtl-nieuws-132237/d994dfc1-0550-30dc-917e-8be2baae13c6">RTLXL</a>, <a href="https://www.rtlnieuws.nl/nederland/afkickkliniek-voor-suikerverslaafden-die-continu-verleid-worden">RTL Nieuws</a>, <a href="http://www.parool.nl/amsterdam/amsterdam-krijgt-tijdelijke-afkickkliniek-voor-suikerverslaafden~a4410275/">Parool</a>, <a href="http://m.telegraaf.nl/binnenland/article/26968252/-tijdelijk-afkickcentrum-suiker-in-amsterdam">Binnenland</a>, and radio stations Radio 1, 538 Nieuws, ANP, Q-Music &amp; BNR, with the Interactive Mirror being a regular highlight of the show. The famous and animated chef and food TV presenter, Pierre Wind, almost got run over by a tram in his excitement while filming his piece on our exhibition.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/IMG_4560-1.JPG" class="kg-image" alt="Building an Interactive Mirror with Unreal Engine and Microsoft Kinect"><figcaption>Careful Pierre!</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: embed--><figure class="kg-card kg-embed-card kg-card-hascaption"><iframe width="480" height="270" src="https://www.youtube.com/embed/_208AiFH8Bk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><figcaption>Media coverage by RTL Live</figcaption></figure><!--kg-card-end: embed--><!--kg-card-begin: markdown--><p>This was a really awesome project to work on, mainly because I finally had the chance to fool around with Unreal. Now I'm keen to learn and do more things with it! If you're in Amsterdam from the 7th to the 13th of November'16, check out the exhibition at <a href="https://www.google.com/maps?ll=52.365791,4.885773&amp;z=16&amp;t=m&amp;hl=en-GB&amp;gl=NL&amp;mapclient=embed&amp;q=Leidsestraat+46+1017+PC+Amsterdam">Leidsestraat 46, 1017 PC Amsterdam</a>.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: embed--><figure class="kg-card kg-embed-card kg-card-hascaption"><iframe width="480" height="270" src="https://www.youtube.com/embed/_8EclSxDuaE?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><figcaption>A quick time lapse of the project development: Learn basics in Unreal &gt; Integrate the Kinect &gt; Prototype with some meshes &gt; Implement a rigged skeleton &gt; Polish the materials and textures &gt; et voila!</figcaption></figure><!--kg-card-end: embed-->]]></content:encoded></item><item><title><![CDATA[What I learnt building Tetris in vanilla JS]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><a href="http://noahdecoco.com/projects/tetris/">Tetris</a> might seem like a simple enough game upfront. It's easy to understand and simple to play, but that's exactly what makes it challenging to build. There are many nuances to consider that only come to light when actually building the game. The most challenging part I faced was making</p>]]></description><link>https://blog.noahdecoco.com/what-i-learnt-building-tetris/</link><guid isPermaLink="false">5da44b5758d3873806c22f8e</guid><category><![CDATA[vanilla js]]></category><category><![CDATA[front-end]]></category><category><![CDATA[tetris]]></category><category><![CDATA[game dev]]></category><category><![CDATA[html canvas]]></category><dc:creator><![CDATA[Noah Fernandes]]></dc:creator><pubDate>Wed, 28 Sep 2016 10:19:00 GMT</pubDate><media:content url="https://blog.noahdecoco.com/content/images/2019/10/tetris-screenshot.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://blog.noahdecoco.com/content/images/2019/10/tetris-screenshot.jpg" alt="What I learnt building Tetris in vanilla JS"><p><a href="http://noahdecoco.com/projects/tetris/">Tetris</a> might seem like a simple enough game upfront. It's easy to understand and simple to play, but that's exactly what makes it challenging to build. There are many nuances to consider that only come to light when actually building the game. The most challenging part I faced was making sure that the pieces don't go off screen or overlap other 'fixed pieces' when rotating.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/rotate-gif-1.gif" class="kg-image" alt="What I learnt building Tetris in vanilla JS"><figcaption>Staying within the view</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/rotate-gif-blocks-1.gif" class="kg-image" alt="What I learnt building Tetris in vanilla JS"><figcaption>Finding the space to rotate</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>Each piece, or sigil as I like to call them, is made of a 4x4 grid. The green cells that are 'solid' and have a value of '1'. The cells with the value '0' don't get rendered in the final production, but I've coloured them a translucent grey to demonstrate the grid concept in these gifs. Below is the code for the mirrored &quot;L&quot; piece in the first gif above.</p>
<pre><code>[
    [0],[0],[1],[0],
    [0],[0],[1],[0],
    [0],[1],[1],[0],
    [0],[0],[0],[0]
]
</code></pre>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>To add my own twist to the game, I made a 'bomb' sigil which explodes and destroys other blocks in a 1 cell radius. This made the gameplay more interesting than I imagined. Sometimes they helpfully get you out of a sticky situation, but sometimes, they force you to demolish what you tried to carefully build making it harder to clear rows.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: image--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.noahdecoco.com/content/images/2019/10/bomb-gif-1.gif" class="kg-image" alt="What I learnt building Tetris in vanilla JS"><figcaption>Drop the bomb!</figcaption></figure><!--kg-card-end: image--><!--kg-card-begin: markdown--><p>Below we have code that rotates the sigil. It might seem a bit daunting at first, but all it does is just shift the 1's and 0's around. Well, first it checks if the sigil is a bomb. Since bombs are only 1x1, we don't want to rotate it. Then, it creates a temporary sigil (tempSigil) to calculate where the real sigil (_currSigil) would be AFTER it's rotated. And if calculations return that the temporary sigil isn't restricted by other fixed blocks, we set the real sigil to the temporary one.</p>
<pre><code>var _rotate = function() {
    if(_bomb) return; // Do not rotate if it's a bomb
    var tempSigil = [];
    var i = 0;
    tempSigil.length = _currSigil.length;
    
    for (i = 0; i &lt; _currSigil.length; i++) {
        var x = i % _row;
        var y = Math.floor(i/_row);
        var newX = _row - y - 1;
        var newY = x;
        var newIndex = newY * _row + newX;
        tempSigil[newIndex] = _currSigil[i];
    }
        
    // Only rotate if the sigil has space to rotate
    if(_hasSpaceToBe(tempSigil)) {
        _currSigil = tempSigil;
    }
};
</code></pre>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>While I learnt a lot from this exercise, like the proper way to build a game-loop, handle multiple scenes and build a Finite State Machine, my initial main aim of building a Tetris clone was to improve my understanding of various design patterns, decoupling and abstraction in Javascript.  I built the game in a highly decoupled way, where every 'module' or piece of the game only knows about each other and a 'game core'. Here's where the Observer and Interface pattern come in handy. The modules never talk with each other, so if any one of them break, the rest stay intact, making it easy to debug and also to extend the functionality of the game. I won't go into those details in this article, but you can get the sourecode <a href="https://github.com/noahdecoco/Tetris-Clone">on Github</a>.<br>
To all junior developers <strong>serious</strong> about improving their code skills in any Object Oriented Language, I highly recommend</p>
<ul>
<li>watching Nicholas Zakas's presentation, <a href="https://www.youtube.com/watch?v=vXjVFPosQHw">Scalable JavaScript Application Architecture</a>,</li>
<li>reading Addy Osmani's book, <a href="https://addyosmani.com/resources/essentialjsdesignpatterns/book/">Learning JavaScript Design Patterns</a></li>
<li>as well as Bob Nystrom's book, <a href="http://gameprogrammingpatterns.com/contents.html">Game Programming Patterns</a>.</li>
</ul>
<p>All of them are available online for free and have immense amounts of information about building large scale applications and games. These articles made a big impact on my skills as a junior developer and I'm greatly thankful to them for it.</p>
<p>Alright, time to <a href="http://noahdecoco.com/projects/tetris/"><strong>PLAY THE GAME</strong></a>. Enjoy!</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Hopefully, not just another blog]]></title><description><![CDATA[<p>This is my third blog that I've tried to maintain. Or is it the fourth? Somehow, they never seem to last.</p><p>Oh well, maybe this time...</p>]]></description><link>https://blog.noahdecoco.com/hopefully-not-just-another-blog/</link><guid isPermaLink="false">5da44af358d3873806c22f85</guid><dc:creator><![CDATA[Noah Fernandes]]></dc:creator><pubDate>Tue, 06 Sep 2016 10:17:00 GMT</pubDate><media:content url="https://blog.noahdecoco.com/content/images/2019/10/Screenshot-2019-10-14-at-12.43.50.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.noahdecoco.com/content/images/2019/10/Screenshot-2019-10-14-at-12.43.50.png" alt="Hopefully, not just another blog"><p>This is my third blog that I've tried to maintain. Or is it the fourth? Somehow, they never seem to last.</p><p>Oh well, maybe this time...</p>]]></content:encoded></item></channel></rss>