{"html":"<h1 id=\"pageTitle\" data-x=\"50\" data-y=\"70\" data-fontSize=\"45\" data-gap=\"2\" data-size=\"2\">Running Red</h1><section class=\"container mt-3\"><div class=\"panel details\"><div class=\"w-100 mx-auto\"><div class=\"details-links row w-100 mx-auto p-0 position-relative\"><a class=\"col-6 me-auto text-start ps-0 p-md-0 view-site effect-tilt\" href=\"https://red.nrjohnson.net/\" target=\"_blank\"><div class=\"button\"><span>View Live Site</span></div><span class=\"shadow\"></span></a><a class=\"col-6 ms-auto pe-0 p-md-0 effect-tilt\" href=\"https://github.com/nr-johnson/running-red\" target=\"_blank\"><div class=\"button ms-auto position-relative\"><span>View GitHub Repo</span></div><span class=\"shadow\"></span></a></div><hr/><div class=\"details-img\"><figure class=\"m-0\"><img src=\"https://res.cloudinary.com/nrjohnson-cloud/image/upload/v1672326520/portfolio/projects/Thumbnail_n9zuff.png\" alt=\"NRJohnson - Running Red\"/></figure></div><p>I recently took Harvard's CS50 Introduction to Computer Science course. This was my final project. It's a simple platformer game with a single level. It contains three enemy types, projectiles, resource collection (arrows/health), parallax backgrounds and more. You can read more about how I structured the game on <a href=\"https://github.com/nr-johnson/running-red\" target=\"_blank\">github</a>.</p><h4>The Builder:</h4><p>Building the level layout was a particular challenge. I struggled to find a way that allowed me to add the elements needed, with the proper collision and images, in a way that allowed efficient editing.</p><p>My solution was to created a page where I could choose the scale of the level, draw/erase blocks with different attributes and place the player and NPCs where I wanted them. This sped the project up considerably as the system I created before relied on manually typing space-separated strings as a map for the game level. Now the builder generates that string for me based on the results of the builder.</p><p>You can view the builder on the game's site at <a href=\"https://red.nrjohnson.net/build\" target=\"_blank\">/build</a>. I included instructions on how to use it on <a href=\"https://github.com/nr-johnson/running-red\" target=\"_blank\">github</a> in the README.</p><h4>Other Obstacles:</h4><p>In my original attempt to make this game I used basic dom elements. This proved unwieldy.</p><p>Organizing the project became a challenge as it grew beyond what I had thought it would be.</p><h4>Solutions:</h4><p>I researched web based games and discovered the Canvas API. Using this tool made the whole project easier and I began to make real progress.</p><p>I ended up relying heavily on Javascript classes to organize the project. Everything within the game is a class object. Learning to code in this way really helped scale the project to the size it needed to be.</p></div></div></section>"}