<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[RocketBit - Medium]]></title>
        <description><![CDATA[What’s going on at the bleeding edge of web and mobile development - Medium]]></description>
        <link>https://medium.com/rocketbit?source=rss----f528044ee702---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>RocketBit - Medium</title>
            <link>https://medium.com/rocketbit?source=rss----f528044ee702---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:55:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/rocketbit" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Procedural Generation in HTML and JavaScript]]></title>
            <link>https://medium.com/rocketbit/procedural-generation-in-html-and-javascript-4bdbbfa6683c?source=rss----f528044ee702---4</link>
            <guid isPermaLink="false">https://medium.com/p/4bdbbfa6683c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[procedural-generation]]></category>
            <category><![CDATA[space]]></category>
            <dc:creator><![CDATA[Beejay Morgan]]></dc:creator>
            <pubDate>Mon, 06 Mar 2017 22:18:28 GMT</pubDate>
            <atom:updated>2017-03-06T22:18:27.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*54D8jiJZ3TxfTiZ_gqHPpg.png" /><figcaption>Generated from the string “Donjon”</figcaption></figure><p>Live demo: <a href="http://codepen.io/beejaymorgan/full/XpGKWJ/">http://codepen.io/beejaymorgan/full/XpGKWJ/</a></p><p><em>NOTE: I’m continually updating and improving this app, so some of the code and explanations below may no longer be accurate.</em></p><p>About a year ago I started building a space exploration game in Node, just for fun. I was hanging out with a group of friends in Discord, and a couple of us decided to create chat bots. Someone opted to use <a href="https://hubot.github.com/">Hubot</a>, and a couple of us started building our own custom bots. I chose to write my own bot interface using NodeJS, with the help of <a href="https://discord.js.org/">discord.js</a>. I created a text-based space exploration MMORPG called <a href="https://storebot.me/bot/rb_spacebot">Protocore</a> (currently only working on Telegram) with a procedurally-generated universe. I won’t go into the details of that project here, but suffice it to say this is the inspiration for my HTML universe. You can even use coordinates from Protocore to find planets.</p><p>There are a lot of 3D JavaScript engines that can build a universe. <a href="http://babylonjs.com/">Babylon.js</a> in particular looks rather impressive. However, since I was more interested in learning than in building a production-ready app, I opted to do everything myself using vanilla JavaScript. Well, nearly vanilla. I did decide to run the JS through <a href="https://babeljs.io/">Babel</a>, which allowed me to employ some new ES6 goodness. I also chose to use pure CSS images, thanks to inspiration from <a href="https://medium.com/u/39cab1e520f8">Michael Mangialardi</a>’s <a href="http://dailycssimages.com/">Daily CSS Images challenge</a>. All imagery is generated through CSS, using gradients, box shadows, and transforms. All animations are done using CSS transitions or keyframe animation.</p><h3>CodePen is my new best friend</h3><p>If you haven’t used <a href="http://codepen.io/">CodePen</a> yet, you’re missing out. Live preview, HTML, CSS, and JavaScript pre-compilers, and the ability to embed one pen in another are just a few of the features that make CodePen worthwhile. It’s a great tool for experimentation, teaching, and prototyping. It’s easy to share what you’re working on, collaborate with others, and get feedback from the community. But enough about that, let’s dig in and see how we generate a universe in HTML.</p><h3>Y U No Canvas?</h3><p>Canvas is next on my list of things to learn. As I stated above, I was inspired by the Daily CSS Challenge, and so I wanted to see just how much we could accomplish using CSS, and how performant it could be. So, while this may not be the most efficient way to build this project, I learned a lot. The possibilities for practical application are pretty massive as well. Effectively using CSS3 animation engages the graphics chipset, which means smoother, more fluid movement. And smoother, more fluid movement means an overall better UX.</p><h3>A few notes</h3><p>This code is far from perfect. There are inconsistencies, inefficiencies, and some things may just be downright wrong. Sometimes it’s on purpose to see which method works better. Sometimes it’s because I learned something new from one piece of code to the next. And sometimes it’s because I was coding it at 2am, or while eating lunch with my 18-month-old son. That’s okay — this isn’t production code. It’s meant to teach both me and you. If you have questions, suggestions, or improvements, I’d love to hear about them in the comments! If you just want to tell me how bad my code is, well, you can go somewhere else.</p><p>So, let’s dig into what we’ve done here. If you have the live <a href="http://codepen.io/beejaymorgan/full/XpGKWJ/">demo link</a> open, you’ll be presented with a procedural starfield generated by a randomized hex string. You have three options: input your own string, allow the system to generate another random string, or travel to a known planet (use a string that is known to generate a planet). Then this seed is injected into a hash generator, which ensures the hash is long enough to generate the universe.</p><pre>// Figure out how long the hash needs to be. <br>// 12 chars for the nebula colors<br>// 6 chars for each nebula cloud<br>// 6 chars for each star<br>let len = ((nebBlobs * 6) + 12) + (numStars * 6);<br>let hash = computeHash(seed, len);</pre><p>That piece of code figures out how long the hash should be. We make enough room to generate nebBlobs number of nebula clouds, numStars number of stars, and space to generate two hex colors for the nebula clouds.</p><p>Next, we need to compute the hash itself:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14453371edccaa28a8df06ea91cb0d8f/href">https://medium.com/media/14453371edccaa28a8df06ea91cb0d8f/href</a></iframe><p>You might notice an ES6 feature in the function above called <a href="http://es6-features.org/#DefaultParameterValues">default parameter values</a>. This allows us to provide starting values for the vars length and prev rather than checking for undefined and then assigning a value. Let’s break the rest of the function down one line at a time.</p><p>The first bit, on lines 3, 4, and 5 uses the <a href="https://github.com/Caligatio/jsSHA">jsSHA cryptography library</a>. We create a new jsSHA object using the SHA-512 algorithm, set the text to our seed (making sure it’s a string), and then get the hexadecimal value of the generated hash. If you’re unfamiliar with hashing algorithms, wikipedia is <a href="https://en.wikipedia.org/wiki/Hash_function">pretty informative</a>. Next, we concatenate the new hash with whatever we passed into the prev variable, which is an empty string the first time and the full hash so far each subsequent time. Finally, we check the length to see if we have enough data to create our scene. If not, we feed our hash back into the function recursively. That’s it!</p><p>Okay, on to creating things. Let’s start with the nebula clouds.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f533a4d46bf4e84c0adfc17d8f9c93cf/href">https://medium.com/media/f533a4d46bf4e84c0adfc17d8f9c93cf/href</a></iframe><p>Here’s where things get a little bit messy. We’ll be dealing with colors and DOM elements. First off, there’s a little piece that repeats itself several times: parseInt(val, 16). Since our hash is a <a href="https://en.wikipedia.org/wiki/Hexadecimal">hexadecimal</a> value, if we need to do math we need to convert it to a standard base 10 integer. This little bit takes the hex value and returns the equivalent decimal value. For instance, the hex value ff would return the decimal value 255.</p><p>So, stepping through our function. We’re going to use a good ol’ for loop to create nebBlobs number of tiny little clouds that will compose the entire colored nebula. But first, we need to decide what colors we’ll be using. We’ll create the colors nebC1 and nebC2 by grabbing a substring of the hash using substr and the Array.map method. We need two colors, each with three components (red, green, and blue), for a total of six values. Since the rgba spec accepts values from 0 to 255, we need two characters from our hash for each value (16 x 16). We use an array created on the fly [0,2,4,6,8,10] to feed into our <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">map</a> function. This allows us to take two characters at a time. We also use a padding value to keep from grabbing values that are part of the planet generator (more on that later). We divide each value by 1.2 to desaturate the color a bit. Finally, on lines 8 and 9 above, we use an awesome new ES6 feature called <a href="http://es6-features.org/#StringInterpolation">string interpolation</a> to create the rgba syntax. The generated values can range anywhere from black (0,0,0) to (213,213,213).</p><p>Now, on to the for loop. We decided ahead of time that we’ll be using nebBlobs number of tiny clouds to generate our nebula. For each tiny cloud, we need four pieces of information: what color it will be, its x and y coordinates, and how large it will be. We’ll use pieces of our hash to determine those values.</p><p>let type = parseInt(hash[cn], 16) &gt; 7 ? nebC2 : nebC1;</p><p>Here, we grab one character from the hash, turn it into a decimal, and check if it’s bigger than 7 (half its possible value). This determines the blob’s color.</p><p>c.x = ((parseInt(hash.substr(cn + 1,2), 16) / 256) * 100);</p><p>Grab two characters from the hash, convert it to decimal, divide by its maximum (255), and multiply by 100 to get a percentage value for the x and y coordinates. The size (c.l) is similar, but we’ll only use one character and multiply by 30 (this gives us a max value of 30%).</p><p>Finally, use string interpolation to create a CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/radial-gradient">radial gradient</a>:</p><p>let s = `radial-gradient(circle at ${c.x}% ${c.y}%, ${type} 0%, transparent ${c.l}%)`;</p><p>Once we’ve generated 100 radial gradients, we add them all to the style tag in the nebula container:</p><p>nebs[curNeb].style[‘background-image’] = gradientString;</p><p>curNeb is always 0 for now. There are 2 nebula layers in the HTML, but we’re only using one of them. At this point, we’ve got a lovely screen full of colored clouds. Now let’s add some stars and actually make this thing look like space!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32fa09dfa377039b0aafb4b030d302a3/href">https://medium.com/media/32fa09dfa377039b0aafb4b030d302a3/href</a></iframe><p>You should be seeing some rather familiar code in this function. The layers variable holds three divs that are each absolutely positioned to cover 120% of the viewport. This allows us a little room to move them back and forth in a nice <a href="https://en.wikipedia.org/wiki/Parallax_scrolling">parallax</a> effect. The first thing we do is remove all the old stars from the layers. We use a while loop on each layer to remove all of its child elements. Next, we determine how many stars will be in each layer. Then, we set up an old-school for loop to create numStars number of stars.</p><p>The variable sn represents the data we already used to create the nebula plus the stars we’ve already created. Each loop will use new data to create a new star. We’ll figure out which layer we want to use by dividing the current loop number by the total number of stars in each layer, and then dropping the decimal place off using the floor method. This should give us a number from 0 to 2 (array indexes start at 0, remember). Just in case something goes wrong, the next line makes sure the layer number is never larger than 2.</p><p>Next, we generate sx, sy, size, and fade values from the hash. The method for generating these is the same as for the clouds above. Create a div with the class name star, and if it’s in the top 10% of brightness and at least 2px big, we’ll give it a lens flare. Then we use a little string interpolation to set the properties, and add it to our selected layer. Great! Rinse and repeat for each star. Now we have a magical star field!</p><h3>But what about the ship and the planets?</h3><p>As of this writing, the planets and the ship are all static. There are 7 planet types, each with or without a ring, for a total of 14 possibilities. All of the planets and the ship are, however, pure CSS. The planets have their own pen here: <a href="http://codepen.io/beejaymorgan/pen/WRVxGj">http://codepen.io/beejaymorgan/pen/WRVxGj</a></p><p>And the ship here: <a href="http://codepen.io/beejaymorgan/pen/oBRBbX">http://codepen.io/beejaymorgan/pen/oBRBbX</a></p><p>If you’re interested in pure CSS imagery, I recommend checking out <a href="https://medium.com/u/39cab1e520f8">Michael Mangialardi</a> as I mentioned above.</p><p>Now, which planet is chosen is procedural. Let’s have a look at that code snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/436e697105f3c49fa96e0299b6594688/href">https://medium.com/media/436e697105f3c49fa96e0299b6594688/href</a></iframe><p>The first thing we do in genPlanet is figure out the decimal value of the first six characters of our hash. That value will be somewhere between 0 and 16⁶. If the value is less than 25 or greater than 28, there’s no planet, so return false immediately (this is a bit of a hack that takes advantage of JavaScript’s loose typing). This gives us a 4 in 16⁶ chance of finding a planet. If you randomly happen upon one, let me know. :-)</p><p>If there <em>is</em> a planet here, we need to calculate its resources in order to determine the planet type. In Protocore, we give planets Minerals, Water, and Dark Matter. So, I’ve carried that over to here using m, w, and d respectively. We pass the resource values into getPlanetType and [somewhat] arbitrarily use those values to determine the planet type. Finally, we give it a 50/50 chance of having a ring, and we send it back to a function that assigns the appropriate class names to the planet div.</p><h3>I like to move it move it…</h3><p>Animation is handled by adding and removing classes, or by setting style properties. Through much research and testing, I’ve discovered that the transform property is really the only one that can be animated without killing the framerate. Opacity works as well, but can still cause problems. The parallax layers are positioned absolutely using CSS, and then animated by using the transform: translate(x, y) CSS property. Keyframe animations on the ship and planet also exclusively use the transform property for movement.</p><p>planet.style.transform = “translateX(-500%) scale(0.05)”;</p><p>Transitions and keyframe animations are attached to elements using special classes that can be added/removed in order to move the elements without animation. For instance, the planet animates off the left side of the screen, but then must be moved back to the right side of the screen in order to re-enter as a new planet:</p><p>planet.classList.add(‘static’);<br>planet.style.transform = “translateX(500%) scale(0)”;<br>planet.classList.remove(‘static’);</p><h3>The takeaway</h3><p>HTML and CSS isn’t the best way to draw large scenes like this. The whole project would be better off using canvas and WebGL. Hopefully I’ll get a chance to try it that way, too. The goal is to eventually tie this UI to Protocore’s API. In the mean time, I’ll use what I’ve learned to kick my UI development into a higher gear. It’s a lot of fun to experiment with things, and there are always new things to learn, especially with the pace at which browsers are picking up new features now.</p><p>Have you done procedurally-generated artwork? Link to your projects in the comments. I love to see how art and code cross paths! And if you like what you see here, check out <a href="https://rocketbit.co/">https://rocketbit.co</a> to get in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bdbbfa6683c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocketbit/procedural-generation-in-html-and-javascript-4bdbbfa6683c">Procedural Generation in HTML and JavaScript</a> was originally published in <a href="https://medium.com/rocketbit">RocketBit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Decide If You’re Ready to Hire a Developer]]></title>
            <link>https://medium.com/rocketbit/how-to-decide-if-youre-ready-to-hire-a-developer-5570bf2f25ed?source=rss----f528044ee702---4</link>
            <guid isPermaLink="false">https://medium.com/p/5570bf2f25ed</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[funding]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Beejay Morgan]]></dc:creator>
            <pubDate>Wed, 18 Jan 2017 17:14:12 GMT</pubDate>
            <atom:updated>2017-01-18T17:14:12.427Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vv0HNvRhU0ihKVaBIpDUww.jpeg" /></figure><p>Recently, a potential client came to me looking for a front-end developer. They had an idea and wanted to find out if RocketBit was the right fit to develop this idea. After several vague emails and a phone call, the client suggested I send mockups of the potential UI. At this point, I still had very little idea what the client’s project actually was, and certainly no idea what was going to differentiate this app from the sea of similar apps. So, I threw together some basic wireframes, thinking the client just wanted to make sure I understood the idea. I sent them over and called the client to discuss. As it turns out, the client wanted me to show via full mockups how I would differentiate the app from the competition! This client had no strategy whatsoever, and wanted me to do the legwork, <em>for free,</em> of figuring out how to make the product viable! This phone call was the end of the relationship. This client was clearly not ready to hire a developer.</p><p>After over 15 years in the software industry, I’ve been a part of many ideas. Some are great ideas with poor execution, some are poor ideas with excellent execution, and just a few are unicorns: amazing ideas with superb execution. Though you’ll never do well with a poor idea and poor execution, many times taking a mediocre idea and developing it well can still be a win. I’d like to share a few tips to determine, first of all, if your idea is viable, and second, if you understand and are ready for what happens next.</p><h3>Is my idea viable?</h3><p>Everyone has their pen-on-a-napkin ideas. Most should be thrown out with the napkin, but sometimes those ideas are worth developing. Most of us know when an idea is really bad, so I won’t address that here. And while these questions and tips can be applied in a more general sense, they’re mainly directed toward software applications. So, then, what is it that makes an idea usable?</p><p><strong>Is it original? </strong>This one is probably pretty obvious, but worth mentioning. If your idea is the <em>Next Big Social Network</em>™, bin it. If your idea is <em>Like Tinder, But For ___</em>, bin it.</p><blockquote>Your idea doesn’t have to be the first of its kind, but if a quick Google search reveals <a href="https://www.google.com/search?q=like+tinder+but">multiple pages</a> of results, you may want to pick another idea.</blockquote><p><strong>Does it solve a problem? </strong>Sometimes our great ideas just don’t solve a real-world problem. Building a toaster with a built-in curling iron may be an incredible feat of domestic engineering, but it’s unlikely to be a hit on the store shelves. Software is the same way. If you can’t define the problem you’re trying to solve, then your app idea is going to fall on deaf ears.</p><p><strong>Is it technically viable? </strong>Understand the limitations of the technology you’re employing. If you want to build an iOS app that accesses a Firewire device, you’re going to have a bad time. This question is a little tricky, because you may need to speak to a developer before you know whether the platform you’re choosing can handle what you’re throwing at it.</p><h3>Is my funding secured?</h3><p>If you’re going to approach a developer about building your app, understand that you’ll need to have funding in place. Asking a developer to build your app for a percentage of profits, or for a stake in the company, is asking the developer to <em>invest</em> in your idea. And while you may believe your idea will be hugely successful and worth the investment, the developer has no way to know that. There are always certain cases where this type of arrangement makes sense, but those are few and far between.</p><p>The best way to get a developer all-in on your idea is to tell him or her that you’ve already secured the funding, that you understand what development costs should be, and that you’re ready to make this thing happen. Most developers and agencies will ask for a deposit before beginning any work on the project. If the developer knows that payment is coming, they’ll be much more likely to give you top priority, especially if they’re a freelancer.</p><h3>Do I want a code monkey, or a partner?</h3><p>Many entrepreneurs start out by outsourcing their development work. There are benefits to this, of course, in the way of low development cost and fast turnaround. Unfortunately, most of the time, outsourcing your development work will put you in the position of CEO, Product Manager, <em>and </em>Project Manager. You’ll get exactly what you ask for. Nothing more, and (usually) nothing less. You really do get what you pay for in this circumstance.</p><blockquote>A developer or agency who understands your vision can turn a good idea into an amazing product.</blockquote><p>Look for a developer who will tell you when your ideas are good, but also let you know when your ideas are not so great. Look for someone who has experience in the field, who is willing to put the time in to get the project right, and who gives quality feedback.</p><p>Another aspect of finding a good developer is the quality of the code. I’ve worked with outsourced code that is a spaghetti-mess of methods, classes, and variables. In a single file, the same word was misspelled three different ways. This makes adding features, fixing bugs, and improving UX an absolute nightmare for the next developer. Sometimes the whole project has to be scrapped and rewritten from the ground up.</p><h3>What about NDAs and the like?</h3><p>NDAs are nearly useless under most circumstances. If every potential client required a developer to sign an NDA, it wouldn’t take long at all for the developer to accidentally breach one. There is a lot of idea overlap amongst entrepreneurs. Even if someone does run off with your idea after signing your NDA, it would require hiring a lawyer, filing a lawsuit, and proving there was infringement in order to enforce the NDA. Unless you’ve got high-value trade secrets or intellectual property at stake, there’s no reason to worry about an NDA.</p><p>Ideas have little value without execution. Sharing your high-level vision of your idea with potential developers, other entrepreneurs, and investors is a great way to test the viability of your project. Once you’ve decided to work with a specific developer, however, make sure there’s a solid contract in place which gives you ownership of the code.</p><p>If you feel confident about your project after reading through these points, it’s time to take the next step.</p><h3>What now?</h3><p>At <a href="https://rocketbit.co/">RocketBit</a>, we’re ready to be your partner. We’ve got experience where it counts, and we’re ready to share it with you. We work on modern technology stacks, on modern platforms, with modern coding standards. We can help you design your User Interface, architect your database, and construct your build pipeline. Our developers, designers, and marketers each have a proven track record of successful and solid projects. Email me at <a href="/service/mailto:beejay@rocketbit.co">beejay@rocketbit.co</a> and let us help you get your rocket off the launchpad.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5570bf2f25ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocketbit/how-to-decide-if-youre-ready-to-hire-a-developer-5570bf2f25ed">How to Decide If You’re Ready to Hire a Developer</a> was originally published in <a href="https://medium.com/rocketbit">RocketBit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>