<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Somethinghitme</title>
        <link>https://somethinghitme.com</link>
        <description>My Code, demos and ideas.</description>
        <lastBuildDate>Tue, 17 Mar 2026 17:21:46 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Somethinghitme</title>
            <url>https://somethinghitme.com/assets/favicon.svg</url>
            <link>https://somethinghitme.com</link>
        </image>
        <copyright>© 2026, Jason Brown</copyright>
        <item>
            <title><![CDATA[How can I get free vibes!! AI coding for free guide]]></title>
            <link>https://somethinghitme.com/2026/03/17/how-can-i-get-free-vibes/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2026/03/17/how-can-i-get-free-vibes/</guid>
            <pubDate>Tue, 17 Mar 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Lots of new shiney tools are coming out people are building great stuff, but there's a cost, how you can get started for free!]]></description>
            <content:encoded><![CDATA[<p><a href="/2026/03/17/how-can-i-get-free-vibes/images/hero.webp"><img src="/2026/03/17/how-can-i-get-free-vibes/images/hero.webp" alt="hero image" /></a></p>
<h2 id="thebarriertoentryisgone">The barrier to entry is… gone?</h2>
<p>Everyone's talking about vibe coding, everyone's also talking about thousands in tokens, thousands of dollars in local setups. If you're just getting started and want to experiment, and have a budget of $0, where can you even begin? Good news you can get started for the low low price of $0!</p>
<p>There are free models available right now from multiple providers. Some are cloud-hosted, some you can run locally if you have the hardware. Pair them with the right coding harness and you've got a working setup without spending a dime.</p>
<p>This isn't a step-by-step walkthrough. I'll cover the options, the trade-offs, and point you to the right links. You're smart enough to follow setup docs.</p>
<h2 id="thefreemodelproviders">The Free Model Providers</h2>
<h3 id="openroutertheeasiestonramp">OpenRouter - The easiest on-ramp</h3>
<p><a href="https://openrouter.ai">OpenRouter</a> acts like a gateway. One account, one API key, access to a ton of models. Some of them are free.</p>
<p>Sign up, grab your API key, and browse the free models here: <a href="https://openrouter.ai/models?q=free">https://openrouter.ai/models?q=free</a></p>
<p>A couple worth looking at right now
<strong>NOTE: this was written 3/17/2026 these will change and can go away at any time. I'll try to update when this happens.</strong></p>
<ul>
<li><strong><a href="https://openrouter.ai/openrouter/healer-alpha">Healer Alpha</a></strong> - 262k context window, solid for longer sessions</li>
<li><strong><a href="https://openrouter.ai/openrouter/hunter-alpha">Hunter Alpha</a></strong> - 1 trillion parameter model, designed specifically for AI agents</li>
</ul>
<p>One thing to know: individual free models get hammered. They're rate-limited and sometimes just unavailable because everyone's hitting them. OpenRouter has a <strong>"free model router"</strong> option that spreads your requests across whatever free models are currently available. It's more reliable than pinning to a single model.</p>
<p>There's a caveat floating around that you might need $10 of credit in your OpenRouter account for the free tier to work. I've seen it work without it, but if you're getting errors that's a good first thing to try.</p>
<p>The nice part about OpenRouter is the upgrade path. If you outgrow free models you can switch to something like <strong>MiniMax MoE 2.5</strong> which is strong for coding and way cheaper than Claude Opus. Same API key, just change the model name.</p>
<h3 id="nvidiabuildfreetierseriousmodels">NVIDIA Build - Free tier, serious models</h3>
<p>NVIDIA has their own model hosting at <a href="https://build.nvidia.com/models">build.nvidia.com/models</a>. Create an account, get an API key, pick a model.</p>
<p>Worth checking out:</p>
<ul>
<li><strong>GLM 5</strong></li>
<li><strong>Kimi K-25</strong></li>
<li><strong>MiniMax</strong></li>
</ul>
<p><strong>Make sure to select the Free Endpoint filter</strong></p>
<p><a href="/2026/03/17/how-can-i-get-free-vibes/images/nvidia.webp"><img src="/2026/03/17/how-can-i-get-free-vibes/images/nvidia.webp" alt="nvidia" style="max-height: 200px; width: auto;" /></a></p>
<p>I <a href="/blog/2026/01/20/vllm-tuning-for-low-memory/">wrote about running GLM-4.7-Flash locally</a> with vLLM and all the VRAM tuning that goes with it. With NVIDIA's API you can hit these same model families without owning any hardware at all. That's a big deal if you just want to get coding.</p>
<h3 id="lmstudiollamacppthepoweruserpath">LM Studio &amp; llama.cpp - The power-user path</h3>
<p>This section is for people who have GPUs and want full control. No rate limits, no internet dependency, no one else's terms of service.</p>
<p><strong><a href="https://lmstudio.ai/">LM Studio</a></strong> is the easy button for running models locally. Download it, search for a model, click run, and you've got an OpenAI-compatible API on localhost. It has a clean UI for managing models and tweaking settings without touching the command line. If you've never run a local model before, start here.</p>
<p><strong><a href="https://github.com/ggml-org/llama.cpp">llama.cpp</a></strong> gives you maximum flexibility. It truly pools your VRAM across GPUs which means if you have multiple cards you can use all of it. I covered the differences between vLLM and llama.cpp in my <a href="/blog/2026/01/20/vllm-tuning-for-low-memory/">vLLM tuning article</a>. The short version: llama.cpp pools your VRAM and is more forgiving for single-user setups. vLLM is faster for multi-user but each GPU is its own island.</p>
<p><strong><a href="https://ollama.com/">ollama</a></strong> Ollama is great for beginners… however it has some issues only recommended if the above options just don't work.</p>
<p>If you're going the local route, the <a href="https://huggingface.co/collections/unsloth/qwen35">Qwen 3.5 models</a> are worth looking into. The 9B is very capable and can run on a 3060 with 12GB of VRAM. The 27B is a step up in quality but you'll need something beefier like a 24GB card. Both punch well above their size for coding tasks.</p>
<p>The trade-off is obvious. You need the hardware. But you own the whole stack and nobody can rate-limit you.</p>
<h2 id="theharnesseswherethevibesactuallyhappen">The Harnesses - Where the vibes actually happen</h2>
<p>A model by itself doesn't do much for you. You need something that connects it to your codebase, your terminal, your files. That's what these tools do.</p>
<h3 id="claudecode">Claude Code</h3>
<p><a href="/2026/03/17/how-can-i-get-free-vibes/images/claude.webp"><img src="/2026/03/17/how-can-i-get-free-vibes/images/claude.webp" alt="nvidia" style="max-height: 200px; width: auto;" /></a></p>
<p>This is what I use daily. I <a href="/blog/2026/01/31/creating-local-claude-code-plugins/">wrote about creating local plugins for it</a> and it's become central to how I work. The same tool can be pointed at free models through OpenRouter or NVIDIA.</p>
<p>The setup is a <code>settings.json</code> with your API key, base URL, and model name. You can scope it to a single project or set it globally. The <a href="https://docs.anthropic.com/en/docs/claude-code/settings">official docs on third-party model configuration</a> cover the specifics.</p>
<p>I'll be honest though. Claude Code works best with Claude models. Free models won't give you the same experience as Sonnet or Opus. But for learning how vibe coding works and building smaller projects, it's more than enough to get your feet wet.</p>
<h3 id="factorydroid">Factory Droid</h3>
<p><a href="/2026/03/17/how-can-i-get-free-vibes/images/droid.webp"><img src="/2026/03/17/how-can-i-get-free-vibes/images/droid.webp" alt="nvidia" style="max-height: 200px; width: auto;" /></a></p>
<p><a href="https://factory.ai/">Factory Droid</a> is another agent harness similar to Claude Code. It connects to your codebase and lets you work through natural language, same concept but a different tool with its own take on the workflow.</p>
<p>It supports OpenRouter, LM Studio, and any OpenAI-compatible endpoint. Worth trying alongside Claude Code to see which one clicks for you.</p>
<p>Honestly… it's also much cooler looking ;).</p>
<h2 id="thehonesttradeoffs">The honest trade-offs</h2>
<p>Let me be real about what you're getting here.</p>
<p>Free models will not perform like Sonnet 4.6, Opus, or Codex 5.4, but you don't always NEED that level anyway, it can be like using a Bazooka to hunt a bunny… sure it will work but a slingshot would as well.</p>
<p>Another thing to keep in mind you'll hit rate limits. Models will be unavailable at peak times. Responses will be slower and less accurate on complex tasks.</p>
<p>Local models need hardware. If you don't have a decent GPU you're looking at cloud options only.</p>
<p>But for learning, prototyping, side projects, and just seeing what this whole vibe coding thing is about? Free is more than enough to get started. And the upgrade path is smooth. Start with OpenRouter's free tier, and when you're ready to pay for better performance the switch is changing one line in your config.</p>
<h2 id="cheapnotfreenextstepswhenyouwanttovibeharder">Cheap (not free) Next steps when you want to VIBE HARDER!</h2>
<ul>
<li><a href="https://z.ai/subscribe?ic=CASNIDH7IX">The Best one by far (and the cheapest) - z.ai</a> - Referral link for $10 a month and it gives me some free credits! Z.ai is responsible for the GLM models.</li>
<li><a href="https://www.kimi.com/code">Kimi Code</a> - Another great option starting at $20 a month.</li>
<li><a href="https://chatgpt.com/codex">OpenAI Codes</a> - The $20 option is surprisingly good and limits are doubled until April 2nd 2026!</li>
</ul>
<h2 id="wheretogofromhere">Where to go from here</h2>
<p><strong>Model providers:</strong></p>
<ul>
<li><a href="https://openrouter.ai">OpenRouter</a> - <a href="https://openrouter.ai/models?q=free">Free models</a></li>
<li><a href="https://build.nvidia.com/models">NVIDIA Build</a></li>
<li><a href="https://lmstudio.ai/">LM Studio</a></li>
<li><a href="https://github.com/ggml-org/llama.cpp">llama.cpp</a></li>
</ul>
<p><strong>Coding harnesses:</strong></p>
<ul>
<li><a href="https://docs.anthropic.com/en/docs/claude-code">Claude Code</a></li>
<li><a href="https://factory.ai/">Factory Droid</a></li>
<li><a href="https://github.com/openai/codex">Codex CLI</a></li>
</ul>
<p><strong>My previous articles if you want to go deeper:</strong></p>
<ul>
<li><a href="/blog/2026/01/20/vllm-tuning-for-low-memory/">vLLM Tuning For Low Memory</a> - getting the most out of local models with limited VRAM</li>
<li><a href="/blog/2026/01/31/creating-local-claude-code-plugins/">Creating Local Claude Code Plugins</a> - extending your harness with custom tools</li>
</ul>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Creating Local Claude Code Plugins]]></title>
            <link>https://somethinghitme.com/2026/01/31/creating-local-claude-code-plugins/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2026/01/31/creating-local-claude-code-plugins/</guid>
            <pubDate>Sat, 31 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I wanted local plugins, installed for my user, without publishing anything. The easiest path is a local marketplace.]]></description>
            <content:encoded><![CDATA[<p><a href="/2026/01/31/creating-local-claude-code-plugins/images/hero.webp"><img src="/2026/01/31/creating-local-claude-code-plugins/images/hero.webp" alt="hero image" /></a></p>
<h2 id="whatiwantedandwhy">What I wanted (and why)</h2>
<p>I'm on Windows primarily for my normal day to day… I know this is considered weird for many developers. I'm just a creature of habit. All my AI machines are running Linux but there's something that just makes me move faster in Windows.</p>
<p>With that I generally have to wait until support is added from the developer community on plugins, projects, etc. Not anymore with AI! The Ralph Wiggum loop is one of the coolest things I've tried out in a while, and I wanted access on my local work machine, however the issue is it's Bash scripts. Sure I could run it in WSL or Git Bash, but meh why not just use AI to do the entire conversion for me?</p>
<p>That was relatively simple which still feels so crazy to say in this day and age, the things we can do as creatives with an idea and some prompt structure is just amazing.</p>
<p>The next thing I had to figure out was how can I have this accessible at the user scope level so I could use it everywhere?</p>
<h2 id="howcanirunthis">How can I run this?</h2>
<p>You can start Claude Code with the plugin loaded automatically by passing in the path like so:</p>
<p><code>claude --plugin-dir ./my-first-plugin</code> (from the docs)</p>
<p>This is the best way to test and just make sure the plugin is working as expected… but this isn't something you want to do every time.</p>
<h2 id="thesimplestsolutionalocalmarketplace">The simplest solution: a local marketplace</h2>
<p>I couldn't find this in the docs.. I stumbled upon it randomly searching, but to get around this you need to add your plugin to a marketplace. Fortunately a marketplace can live anywhere to include your personal machine. I ended up pushing it to GitHub with the thousands of others because I love tracking my contributions over the year of course.</p>
<ul>
<li>Source: https://github.com/loktar00/my-claude-plugins</li>
</ul>
<p>The following is the structure of a plugin marketplace (a single json file), and a plugin.</p>
<pre><code class="text language-text">my-claude-plugins/
├── loktar-marketplace/
│   ├── .claude-plugin/
│   │   └── marketplace.json
│   ├── my-first-plugin/
│   │   ├── .claude-plugin/
│   │   │   └── plugin.json
│   │   ├── commands/
│   │   │   └── hello.md
│   │   ├── hooks/
│   │   │   └── hooks.json
│   │   └── scripts/
│   │       └── hello.ps1
└── README.md
</code></pre>
<h2 id="marketplacemanifestmarketplacejson">Marketplace manifest (marketplace.json)</h2>
<p>This is really all you need it establishes your marketplace, who owns it, and any of the plugins being offered. What's most important (besides the obvious valid JSON) is the location of the plugins, I tried a few ways such as having the marketplace as a peer of the plugin directory, however what ended up working for me was putting the plugins under the marketplace.</p>
<pre><code class="json language-json">{
  "name": "loktar-dev",
  "owner": { "name": "Jason" },
  "plugins": [
    {
      "name": "my-first-plugin",
      "source": "./my-first-plugin",
      "description": "TODO: one-line description"
    }
  ]
}
</code></pre>
<p>Now add the marketplace, launch Claude Code and type the following</p>
<p><code>/plugin marketplace add ./marketplace-name</code></p>
<p>In my case it was the following, and I was in the parent directory.</p>
<p><code>/plugin marketplace add ./loktar-dev</code></p>
<h2 id="claudecodeplugins">Claude Code Plugins</h2>
<p>I'm not going to go in any detail about plugins here, honestly the official docs do a pretty good job of describing them, and the plugins that exist are great examples. The issue I was facing was all about getting them installed easily so I could access in all instances.</p>
<h2 id="installingatuserscopenoadmin">Installing at user scope (no admin)</h2>
<p>As long as you have the above setup you can launch Claude Code, type <code>/plugins</code> move over to marketplaces and you should see yours show up.
<a href="/2026/01/31/creating-local-claude-code-plugins/images/example.webp"><img src="/2026/01/31/creating-local-claude-code-plugins/images/example.webp" alt="marketplace" /></a></p>
<p>Select your marketplace and you should see your plugin ready to install</p>
<p><a href="/2026/01/31/creating-local-claude-code-plugins/images/example%202.webp"><img src="/2026/01/31/creating-local-claude-code-plugins/images/example%202.webp" alt="marketplace" /></a></p>
<p>Select the plugin and install for your user.</p>
<p>Now you should have access to the plugin in any instance you open, such as <code>&gt; /ralph-wiggum-windows:help</code> in this example.</p>
<h2 id="troubleshootingandgotchas">Troubleshooting and Gotchas</h2>
<p>If you don't see the plugin you should see an error, the beauty of it all is you can ask Claude Code what's going on. In general it's a pathing or unexpected formatting of the JSON.</p>
<h2 id="closing">Closing</h2>
<p>Things are moving so fast, that this article is already out of date, Ralph Wiggum isn't even the cool hot thing anymore, it's been a week, however the principles will be the same regardless. There's always a problem to solve and if you can ask the right questions the barrier is incredibly low to create or have solutions created.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[vLLM Tuning For Low Memory]]></title>
            <link>https://somethinghitme.com/2026/01/20/vllm-tuning-for-low-memory/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2026/01/20/vllm-tuning-for-low-memory/</guid>
            <pubDate>Tue, 20 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[GLM-4.7-Flash has been released! a 30B-A3B MoE model, I surely can run this on two 5090s... or can I?]]></description>
            <content:encoded><![CDATA[<p><a href="/2026/01/20/vllm-tuning-for-low-memory/images/hero.webp"><img src="/2026/01/20/vllm-tuning-for-low-memory/images/hero.webp" alt="hero image" /></a></p>
<h2 id="theproblemvramisking">The problem VRAM is King!</h2>
<p>I have two AI nodes, one is running two 5090s the other two 3090s with NVLink. They're running Proxmox and containers so it's easy to try different configs, restore backups, etc. Altogether, between these machines, I have 112GB of VRAM, that amount of VRAM allows running of a couple of smaller models or large ones split across all of them via llama.cpp using rpc and vLLM.</p>
<blockquote>
  <p>There's a big difference between vLLM and llama.cpp however, and reasons to use one over the other.</p>
</blockquote>
<h3 id="vllm">vLLM</h3>
<p>If you want fast inference supporting multiple users (or agents) at once the best option is vLLM bar none. However it comes with some drawbacks. VRAM is <em>not</em> pooled like it is in llama.cpp, and all the memory required for the model (including KV cache) are loaded right from the beginning so there are no surprises. You <em>can</em> offload to system RAM but vLLM has flaky support for it, and system RAM is generally magnitudes slower than VRAM killing your performance.</p>
<h3 id="llamacpp">llama.cpp</h3>
<p>If you're ok not having blazing speed via tensor parallel and aren't supporting many users (or agents) and are unsure how much context you're going to end up using anyway, llama.cpp is a great option. With all of this, it truly pools your VRAM meaning in my systems I can load a model right up to the 112GB VRAM limit, it also supports using system RAM by default. You still get the speed penalty but there's no hoops to jump through to get it working.</p>
<h3 id="howdoesthisrelatetoglm47flash">How does this relate to GLM-4.7-flash?</h3>
<p>vLLM is fast like mentioned, really fast. It's able to be so fast due to tensor parallelism. However with tensor parallelism you don't get pooling up to 64GB, you get 32GB (or whatever the size of your cards are). Here's where the issue comes in. Using a 30B BF16 model means it's going to take up roughly 30GB of VRAM leaving you with 2-ish for KV cache. KV cache refers to your context. There's also minor overhead that comes with certain options.</p>
<p>When I tried running the BF16 I was extremely limited, at the end of the day I did get it to work with a context size of 8000 but it wasn't pretty. I soon jumped on the NVFP4 quant that came out a few hours later giving me much more breathing room for context.</p>
<h3 id="helpfulknobsandswitchestogetthemostoutofyourvramwithvllm">Helpful knobs and switches to get the most out of your VRAM with vLLM</h3>
<p>Spoiler, my config that ended up finally working:</p>
<pre><code>export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

uv run vllm serve zai-org/GLM-4.7-Flash \
  --download-dir /mnt/models/llm \
  --kv-cache-dtype fp8 \
  --tensor-parallel-size 2 \
  --max-model-len 8000 \
  --gpu-memory-utilization 0.96 \
  --swap-space 16 \
  --enforce-eager \
  --max-num-seqs 1 \
  --tool-call-parser glm47 \
  --reasoning-parser glm45 \
  --enable-auto-tool-choice \
  --served-model-name glm-4.7-flash \
  --host 0.0.0.0 --port 8000
</code></pre>
<p>There's a few things to notice here.</p>
<ul>
<li><code>--max-num-seqs</code> I generally start out lowering this early on, default is 256, I lower to 20 or so as a starting point.</li>
<li><code>--max-model-len</code> this is the next thing to target if the model still won't load. This is one of the most important and costly settings, this controls the total context size, lowering this can help significantly.</li>
<li><code>--gpu-memory-utilization 0.96</code> Alright… model still won't load let's tweak our memory utilization and make sure we're squeezing the most out of it. This is a value to play with 0.8 to 0.98-ish.</li>
<li><code>--enforce-eager</code> This tells vLLM to run the model in PyTorch eager mode, generally it's for stabilization but can save you a few MB by avoiding compile/capture overhead and reducing annoying memory spikes and fragmentation during startup.</li>
<li><code>--kv-cache-dtype fp8</code> alright we're getting desperate, this drops kv-cache to fp8 from BF16 saving us a little space.</li>
<li><code>--swap-space</code> we're now on our last legs, we're telling vLLM to offload a bit, it's ok to admit defeat here if this doesn't work but it's worth a shot. This is generally when it's time to go to llama.cpp.</li>
</ul>
<p>And (although deprecated) I threw this in for good measure -
<code>export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True</code>
you can use this instead
<code>export PYTORCH_ALLOC_CONF=expandable_segments:True</code>.</p>
<p>This basically tells PyTorch's CUDA memory allocator to use expandable memory segments instead of using fixed chunks of VRAM too early. For example, if you have a barge with shipping containers of all different sizes without this flag we'd just carve up the barge into fixed-size chunks based on our largest container… meaning our small ones would take up the same amount of parked space. That's not good. What this does is says hey, let's not chop this up early, let's fit these in here like Tetris.</p>
<p>tldr; it allows you to use your free RAM more efficiently.</p>
<h3 id="inclosing">In closing</h3>
<p>At the end of the day like mentioned I was able to run the NVFP4 with the following config</p>
<pre><code>uv run vllm serve GadflyII/GLM-4.7-Flash-NVFP4 \
  --download-dir /mnt/models/llm \
  --kv-cache-dtype fp8 \
  --tensor-parallel-size 2 \
  --max-model-len 82000 \
  --trust-remote-code \
  --max-num-seqs 4 \
  --tool-call-parser glm47 \
  --reasoning-parser glm45 \
  --enable-auto-tool-choice \
  --served-model-name glm-4.7-flash \
  --host 0.0.0.0 --port 8000
</code></pre>
<p>Able to run with 82000 context which is plenty for the work I'm doing. At the end of the day it's important to understand the differences between vLLM and llama.cpp and not to be afraid of tweaking the settings to get one working. As models are released vLLM is generally supported first, so it's good to understand and learn if you're on the bleeding edge. Just remember all GPUs !== pooled VRAM with vLLM.</p>
<h3 id="themodels">The Models</h3>
<ul>
<li><a href="https://huggingface.co/zai-org/GLM-4.7-Flash">GLM 4.7 Flash</a></li>
<li><a href="https://huggingface.co/GadflyII/GLM-4.7-Flash-NVFP4">GLM 4.7 Flash NVFP4</a></li>
</ul>
<p>As an aside GLM 4.7 Flash is great for local development, it <em>may</em> displace my current local favorite Devstral Small, as I play with both more I may jot down my thoughts here in a future article.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[I'm not a 'Real' Engineering Manager, I'm a Player-Coach]]></title>
            <link>https://somethinghitme.com/2026/01/16/im-not-a-real-engineering-manager-player-coach/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2026/01/16/im-not-a-real-engineering-manager-player-coach/</guid>
            <pubDate>Fri, 16 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[For the last two years I've worked as an Engineering Manager at a small startup, every day either feeling like I'm failing the job because what I do doesn't fall into the typical EM role. I realized I was measuring myself against a whole support structure I don't have.]]></description>
            <content:encoded><![CDATA[<p><a href="/2026/01/16/im-not-a-real-engineering-manager-player-coach/images/image.webp"><img src="/2026/01/16/im-not-a-real-engineering-manager-player-coach/images/image.webp" alt="hero image" /></a></p>
<h2 id="themythofafulltimestrategizingmanager">The Myth of a full-time "strategizing manager"</h2>
<p>For a small team in a startup environment strategizing isn't an 8-hour day 5 days a week. Management work often comes in bursts. If you force it, you end up with meetings that don’t move work forward.</p>
<blockquote>
  <p>On a small team, you either ship or you invent work.</p>
</blockquote>
<p>Now that's not to say there's not a lot of work to be done, my job has consisted of the following and more:</p>
<ul>
<li>Establishing baseline standards and etiquette for PRs, and codebases</li>
<li>Guiding the direction and strategy for consolidating tech stacks</li>
<li>Researching, advocating for, and acquiring industry solutions for things like feature flags, Sentry, AI tooling</li>
<li>Advocating and setting standards for tech debt work within sprints</li>
<li>Establishing and evolving our delivery and agile processes over time</li>
<li>Work with product on features, and MVP direction, requirements, and feasibility</li>
<li>Regular bi-weekly 1:1s and 6-month reviews with each team member.</li>
</ul>
<p>If you're in a similar role none of this is new. But as a leader you should allow the team the freedom to explore and bring the solutions. Your job and experience allow you to see the whole picture and guide and decide based on what you're given.</p>
<p>So what do you do with the leftover? You get in the trenches with the team and you produce. I try to contribute meaningfully every week, without stealing ownership from the team.</p>
<p>Unfortunately right now I'm not always succeeding at that, we're thinner than we used to be in some key areas, and the work still has to ship. This isn't an attempt to outshine anyone on the team.</p>
<p>It's the complete opposite. It's a way to show I'm here with you. I will push as hard as I can to ensure we all make it across the line together. I don't always meet that goal, some weeks are heavier with strategizing than others, but at the end of the day that's what makes me feel like I've actually "worked" for the day.</p>
<h3 id="howdidigethere">How did I get here?</h3>
<p>I love the company I work for, I work for an extremely fast-paced small startup in the Christian space. I remember it clearly when I was offered the role of Engineering Manager, at the time I was hired as a lead Frontend Developer who somehow ended up maintaining three legacy Java codebases as a solo dev, and troubleshooting users' personal PCs. I had no idea how I got into the position I was in. It surely wasn't any Frontend Lead position I was used to.</p>
<p>When I was approached for the Engineering Position at the company's adjacent startup I jumped at the role. During the interview process for the EM role I was told I wouldn't need to develop, and in fact I shouldn't. I was taken aback, the role was to manage 6 engineers in the startup, along with the current role I was leaving. I thought to myself there's no way with so few people we could afford to NOT have someone actively contributing to solutions.</p>
<h3 id="whatmyroleactuallylookslike">What my role actually looks like</h3>
<p>Every time I take training on EM roles, read up on what I should be doing I begin to feel like a failure, like I'm letting the team down. I should be doing MORE strategizing, MORE unblocking, and no development.</p>
<p>I realized I'm not failing, and that I'm doing the best I can as an EM.</p>
<ul>
<li>I unblock hard problems for the team and provide direction</li>
<li>I prevent regressions</li>
<li>I set standards</li>
<li>I keep the team focused on what's important now, and most importantly the WHY</li>
<li>I translate the chaos into something we can build</li>
<li>I try as hard as I can to protect people from thrash.</li>
</ul>
<p>Coding is not the enemy.</p>
<blockquote>
  <p>If I'm not close to the code, I'm not close to reality.</p>
</blockquote>
<p>It keeps me connected to reality, it keeps my judgment sharp, it gives me credibility, and it lets me remove some of the hardest blockers fast.</p>
<p>Much of my leadership style comes from what I learned from the military. The best leaders I remember by name didn't hide behind rank, they worked with us, trained with us, and didn't delegate effort they weren't willing to give themselves. That's always stuck with me.</p>
<hr />
<h3 id="thewarning">The Warning</h3>
<p>This is all well and good. The danger isn't me developing. The real danger is me becoming the bottleneck and the single point of failure. If that happens, it means something is broken, and there is a possibility I could be part of the problem. With recent staffing changes I'm closer to being a single point of failure than I want to be.</p>
<p>Before the recent departure of my teammate and friend, there was a healthy split. I took baseline work and small bugs so big features can move and the developer didn't need to focus on the noise, or we would swap the roles depending on risk and priority. I would stay out of the way but I made sure I was present when it mattered. No matter what the day looked like I would review PRs that same day.</p>
<p>How can we ensure we don't fail? As a leader you're the one who has to make the hard decisions. This one could be the hardest I've made yet. The goal now (and one I've started) is to train other members of the team on the Frontend stack. We still need to ship as fast as we were. We still need to get features done. The hard part is we're just going to have to be more pragmatic about scope and polish while we rebuild the redundancy we had in the past.</p>
<h3 id="amifailing">Am I failing?</h3>
<p>If the system isn't stable it will feel like you're failing even when you're doing everything right. No matter what it's impossible to "lead" your way out of things like shifting priorities, and limited staffing redundancy.</p>
<p>What I'd tell anyone in my position is the following.</p>
<blockquote>
  <p>Don't apologize for doing the work. Just don't become the work.</p>
</blockquote>
<ul>
<li>Do not apologize for being hands-on.</li>
<li>Protect a commitment window.</li>
<li>Always make risk visible</li>
<li>And do not measure yourself against roles especially when your company size doesn't match.</li>
</ul>
<p>I don't see myself as a manager who develops on the side, I'm a builder who leads, because that's the job this company actually needs from me right now, and that's the role I'm here to fill.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Cloudflare Tunneling and Access Control for locally hosted services]]></title>
            <link>https://somethinghitme.com/2026/01/04/cloudflare-tunnels-and-access-controls/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2026/01/04/cloudflare-tunnels-and-access-controls/</guid>
            <pubDate>Sun, 04 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I've been running local LLMs for over a year at this point, and while it's been great my family members have asked for access, some who don't live in the house anymore. There's a myriad of services that do this. In the past I've used ngrok for solutions, or even just set up a VPN through my home router and given access to my kids. None of them were as straightforward as what I found using Cloudflare.]]></description>
            <content:encoded><![CDATA[<h3 id="whatyouneedbeforeyoustart">What you need before you start</h3>
<ul>
<li>A Cloudflare account (free)</li>
<li>A domain you can point to Cloudflare</li>
<li>A machine/container inside your network to run <code>cloudflared</code></li>
<li>The local URL of the service you want to expose (like <code>http://localhost:5678</code>)</li>
</ul>
<h2 id="thescenario">The Scenario</h2>
<p>I've been running local LLMs for over a year at this point. It's been great.</p>
<p>Recently my family asked for access, including a couple who don't live in the house anymore.</p>
<p>There's a bunch of ways to do this. In the past I've used ngrok, or I just set up a VPN on my home router and gave my kids access. None of them were as straightforward as what I found using Cloudflare.</p>
<blockquote>
  <p>Note: I'm keeping this post focused on getting a tunnel working and putting Access in front of it.
  I'm not covering WAF rules, rate limiting, hardening the service itself, or anything beyond basic access control.</p>
</blockquote>
<h3 id="entercloudflare">Enter Cloudflare</h3>
<p>The short version is: Cloudflare Tunnel gives you the connection, and Cloudflare Access puts a simple login wall (in my case email) in front of it.</p>
<p>I've been on a recent Cloudflare kick. Granted of course I started RIGHT before their most recent outages, but putting those aside I've been incredibly happy with their services.</p>
<p>I've used them on my wife's real estate site to block a few regions that have been needlessly beating up the site along with default AI blocking. Additionally, at my day job I directed the engineering team to look into it as a possible solution to some spam we were dealing with. After acknowledging this would be a good fit, we implemented it across all of our publicly hosted applications and not only has it significantly decreased spam (practically to 0), it also cached a few services, increasing speed across the applications significantly, over 50% in some cases.</p>
<h2 id="localservicesandtunnels">Local Services and Tunnels</h2>
<p>As I mentioned I run a few local AI instances on Proxmox servers in my home (I'll share specs and setups in a future post), however they're all accessible locally within the network. I really never had a major reason to expose any of them until I recently got n8n up and running, and had family members ask if they could access some of my local services since I have some RAG implementations set up for the Bible and other knowledge sets.</p>
<p>The rest of this post will go over setting up a Cloudflare tunnel, and putting email access in front of it, along with the why behind it.</p>
<h3 id="step1cloudflareaccount">Step 1 Cloudflare Account</h3>
<p>If you don't have a Cloudflare account, set one up (this is all free by the way!).</p>
<p>I won't go through the setup here. However, what you're going to want to do once set up is look for Cloudflare One / Zero Trust, and get an account set up through that as well. The default free plan is 50 users, and it's free.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%201.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%201.webp" alt="Step 1 screenshot" /></a></p>
<h3 id="step2domainname">Step 2 Domain Name</h3>
<p>Get a domain name and connect it to Cloudflare.</p>
<p>This part is incredibly simple and one of the strong points of Cloudflare. All settings you currently have will be added and proxied.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%202.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%202.webp" alt="Step 2 screenshot" /></a></p>
<p>Be sure to look them over to ensure all settings have been properly picked up. Once you've confirmed everything looks right, you'll see nameservers provided by Cloudflare. If you're hosting your domain via a third party provider you just need to update your nameservers with them and Cloudflare will take over.</p>
<blockquote>
  <p>Note: Any hosting endpoints, websites, etc. will continue working just as they were before. This isn't a traditional nameserver swap where you lose everything. Cloudflare now has control but it proxies everything that was existing prior.</p>
</blockquote>
<h3 id="step3zerotrustsetup">Step 3 Zero Trust setup</h3>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%203.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/step%203.webp" alt="Step 3 screenshot" /></a></p>
<p>If you set up Cloudflare One / Zero Trust previously to this step you'll see the Zero Trust option. If not, search for Zero Trust and you'll be prompted to set up an account. You have to add a form of payment. However, it is free as long as you stay within the requirements (something we will be doing within this tutorial).</p>
<p>Once you select Zero Trust, go to Networks and Overview. You'll see Manage Tunnels. This is where you want to go.</p>
<h3 id="step4settingupthetunnel">Step 4 Setting up the Tunnel</h3>
<p>For the first screen you'll have two choices. Select Cloudflared.</p>
<p>You may be asking how this works. If not, feel free to skip the following random story I interject.</p>
<p>How this all works is similar to other services which offer similar features. You have a service which runs inside of your network letting Cloudflare know who you are and where you're located.</p>
<p>Funny story, an old friend of mine rolled his own version of this back in the early 2000's. From work he wanted to connect to his IRC server, but like most of us was on a dynamic IP from his ISP that switched more often than he'd like. He had a script which would run and FTP to an external server he owned a txt file with only the IP address of his home network. His IRC script would always hit that txt file in order to get to his home hosted IRC server, and when I say IRC server in reality it was something a few of us did. It was a server running our IRC clients we'd SSH into so all logs and records stayed off of work machines.</p>
<p>Back to the setup, once you choose Cloudflared you'll have to provide a tunnel name. This can be anything. It's only the label within Cloudflare.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/setup%20tunnel.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/setup%20tunnel.webp" alt="setup tunnel screenshot" /></a></p>
<p>Choose the environment you're in. In my case it's Debian. You'll get the commands or executable to run based on the platform and architecture chosen. It's incredibly simple. The main thing they call out, and of course is always a good idea, is don't share your token with anyone. In Debian I chose the option to run as a service, since if I boot my container I want it all working by default.</p>
<h3 id="step5settingupthedomainandpointingtoyourinstance">Step 5 Setting up the Domain and pointing to your instance</h3>
<p>This is probably the biggest potential "gotcha" with the entire setup. In your subdomain use any valid subdomain and choose the domain you added earlier.</p>
<p>For service this is the most important. For Type, if you're actually running HTTPS choose HTTPS here. However, if you're running HTTP locally (I am on most of my instances) choose HTTP here. Cloudflare will still use HTTPS so you don't need to worry.</p>
<p>For URL this is one of the biggest gotchas I've seen when looking at tutorials and setups (comments in videos on Reddit, etc., and really the reason I decided to write this). Use the URL your service is using.</p>
<h4 id="thegotcha">The gotcha</h4>
<p>Use the URL your service is actually listening on, not your public IP.</p>
<ul>
<li>If your service is <code>http://localhost:8080</code>, put <code>http://localhost:8080</code></li>
<li>If your service is <code>http://0.0.0.0:1234</code>, put <code>http://0.0.0.0:1234</code></li>
</ul>
<p>Do not put your external IP here. Also don't swap in <code>192.168.x.x</code> if the service is bound to <code>0.0.0.0</code>.</p>
<p>Once you're set, hit save. Test your tunnel. It should work almost immediately.</p>
<blockquote>
  <p>It's important to note just because a tunnel is set up doesn't mean you lose your original internal way to access the application or service. If you commonly use an internal static IP address that will continue to work and bypass Cloudflare.</p>
</blockquote>
<p>Now you <em>could</em> stop here. However, your service is accessible by anyone and everyone over the internet. Even for instances like OpenwebUI for example which do have internal authentication methods, I really don't feel like having it exposed, and I don't feel like dealing with potential network bottlenecks if I happened to suddenly get hit with tons of requests (although Cloudflare should filter most out).</p>
<p>So it's a good idea to set up Access control, which Cloudflare One also provides, and it's incredibly easy to set up.</p>
<h3 id="step6accesscontrol">Step 6 Access Control</h3>
<p>Navigate to Access Controls and Policies. This is where you can set up reusable policies to apply to any of your Applications.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/addanapplication.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/addanapplication.webp" alt="Add an application screenshot" /></a></p>
<p>Go to add Policy. Within this screen you will have the option for a whole plethora of authentication methods, to include facial scanning. Personally I just chose Email, which is a whitelist of email addresses you provide. You can also control how often you want the token to expire as well. I left mine set at 24 hours.</p>
<h3 id="step7setupanapplication">Step 7 Setup an Application</h3>
<p>Now that you have an access control policy set up, you're going to want to set up an application pointing to your tunnel so you can actually use the access control policy.</p>
<p>Navigate to Access Controls/Applications and click to Add an application. Since this is for a local service, choose Self-hosted.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/Access%20Conrol%20Applications.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/Access%20Conrol%20Applications.webp" alt="Access control screenshot" /></a></p>
<p>You'll be presented with the screen below. Give it a name to identify it, choose your session duration and select <code>Add Public Hostname</code></p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/public%20hostname.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/public%20hostname.webp" alt="Public Hostname screenshot" /></a></p>
<p>Optional subdomain is the one you used when setting up your tunnel above, and choose the domain which has the subdomain on it.</p>
<p>Next go down a little to Access Policies, click <code>Select Existing Policies</code> and choose the one you set up earlier.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/Access%20control%20policies.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/Access%20control%20policies.webp" alt="Access control policies" /></a></p>
<p>Finally test your URL and you should be presented with a screen similar to below. This will depend on the authentication method chosen. In this case it's email.</p>
<p><a href="/2026/01/04/cloudflare-tunnels-and-access-controls/images/cloduflareaccess.webp"><img src="/2026/01/04/cloudflare-tunnels-and-access-controls/images/cloduflareaccess.webp" alt="Cloudflare Access screenshot" /></a></p>
<h3 id="conclusion">Conclusion</h3>
<p>That's it! You should be all set up. Now your local services are exposed but access is controlled through your Cloudflare security policy. Note once a user goes through this they will also need to authenticate with whatever your service has as well. For example, if it's openwebui they'll still need to login to their openwebui account if they weren't already.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Capturing Work Git History for your github activity graph]]></title>
            <link>https://somethinghitme.com/2023/capturing-work-git-history/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2023/capturing-work-git-history/</guid>
            <pubDate>Mon, 24 Jul 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[If your day job repo is not on GitHub, here is how I export commit dates, bucket them, and replay them so my GitHub activity graph matches the work I actually did.]]></description>
            <content:encoded><![CDATA[<h3 id="theproblem">The Problem</h3>
<p>Your working away at your amazing or not so amazing job, pushing branches, comitting code, doing awesome things in general, when you realize…. That's right we don't use Github here! I've been unfortunate enough to work at a few places that don't use Github, but I've wanted to look at my contributions over the year and see how much I've done, plus it's just nice to display publically.</p>
<p>Now before you say it, I know, I know, github activity is not the end all be all, it's not particularly important since you can skew it to your hearts desire… however the same can be said for fitness trackers, or hours on Steam. Everything can be gamed, however if you're disciplined it's nice to see your "real" contributions over time.</p>
<h3 id="thesolution">The Solution</h3>
<h4 id="step1getthecommitdates">Step 1 get the commit dates</h4>
<p>Go into your favorite command line, and browse whatever directory your respository is in. Then run the following command:</p>
<pre><code class="bash language-bash">git log --author=yourEmail@yourCompany.com --pretty=%cd --date=format:'%Y-%m-%d' &gt; stats.log
</code></pre>
<p>This will output a file called stats.log that looks something like this:</p>
<pre><code class="bash language-bash">'2023-03-23'
'2023-03-23'
'2023-03-22'
'2023-03-21'
'2023-03-20'
'2023-03-20'
'2023-03-16'
'2023-03-16'
'2023-03-14'
'2023-03-14'
'2023-03-10'
'2023-03-10'
</code></pre>
<h4 id="step2cleanupthedata">Step 2 clean up the data</h4>
<p>I generally do a quick format, making the dates look like the following:</p>
<pre><code class="JavaScript language-JavaScript">const dates = [
    '2023-03-21',
    '2023-03-20',
    '2023-03-20',
    '2023-03-16',
    '2023-03-16',
    '2023-03-14',
    '2023-03-14',
    '2023-03-10',
    '2023-03-10'
];
</code></pre>
<p>Then I run the following code:</p>
<pre><code class="JavaScript language-JavaScript">const commits = {};

dates.forEach(entry =&gt; {
  if (commits[entry]) {
    commits[entry] += 1;
  } else {
    commits[entry] = 1;
  }
})

const commitData = [];

Object.keys(commits).forEach(commit =&gt; commitData.push({
  date: commit,
  count: commits[commit]
}))

console.log(JSON.stringify(commitData));
</code></pre>
<p>You can either do this in the browser or include it with the node script I'll share further down. It turns the output into the following:</p>
<pre><code class="JavaScript language-JavaScript">    [
        {"date":"2023-05-01","count":5},
        {"date":"2023-03-30","count":2},
        {"date":"2023-03-29","count":2},
        // ...ect
    ]
</code></pre>
<h4 id="step3pushthedatatogithub">Step 3 push the data to github</h4>
<p>I use the following script to add the data to my github activity graph:</p>
<pre><code class="JavaScript language-JavaScript">import fs from 'fs';
import { execSync }  from 'child_process';

const filenames = ['Whatever', 'Files', 'You', 'Want'];

(async function generateHistory() {
    let commitHistory = [];

    filenames.forEach(file =&gt; {
        const data = fs.readFileSync(`${file}.json`, 'utf8');
        const parsedData = JSON.parse(data).filter(el =&gt; parseInt(el.count)).map(el =&gt; {
            const count = parseInt(el.count);
            return new Array(count).fill(el.date);
        });

        commitHistory = [...commitHistory, ...parsedData];
    });

    async function init() {
        for (const history of commitHistory) {
            for (const commit of history) {
                execSync(`echo "${commit}" &gt;&gt; history.txt`);
                execSync(`git add . &amp;&amp; git commit --quiet --date "${commit}" -m "Activity Commit ${commit}"`);
                console.log(commit);
            }
        }
      }

      init();
})();
</code></pre>
<p>Then you just run the script using <code>node script.js</code> And it will modify your local history with the dates and number of commits. These are the core parts of the script:</p>
<pre><code class="JavaScript language-JavaScript">    execSync(`echo "${commit}" &gt;&gt; history.txt`);
    execSync(`git add . &amp;&amp; git commit --quiet --date "${commit}" -m "Activity Commit ${commit}"`);
</code></pre>
<p>The first modifies a file called <code>history.txt</code> and adds a line with the commit so we actually have some changed data. The next line adds the file, creates a commit with the actual date of the commit.</p>
<p>All we need to do after the script runs is push the changes to github and we're done!</p>
<h3 id="conclusion">Conclusion</h3>
<p>You don't have to lose all of your commit history when you leave a job, and you don't have to wonder how your graph might be looking if you had been using github. This is a quick and easy way to capture your work history and add it to your github activity graph that I've been using for years.</p>
<p>I hope you find it useful!</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Recreating this blog with static generation]]></title>
            <link>https://somethinghitme.com/2023/recreating-this-blog-with-static-generation/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2023/recreating-this-blog-with-static-generation/</guid>
            <pubDate>Thu, 15 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[I got tired of fighting WordPress and Gatsby just to publish a post, so I built a small Node script that turns markdown (front matter included) into a static site using EJS templates, plus a couple helpers for gists and code blocks.]]></description>
            <content:encoded><![CDATA[<h2 id="theproblem">The Problem</h2>
<p>Recently I found myself in between jobs so I had some time on my hands to work on a few of my projects I've let languish over the past few years. I always find myself coming back to this blog since it's low risk so I consider it a playground for me to test things out.</p>
<h3 id="abitofhistory20092020">A bit of history 2009 - 2020</h3>
<p>A quick history on this blog and the iterations it's had.</p>
<p>Back in 2009 when blogs were all the rage I threw up a wordpress install made a custom theme and operated using that for years on a shared hosting platform. It worked well for the most part but over the years and with wordpress upgrades and plugins it just became more of a pain. At the end of the day all I really needed were some static pages with my thoughts and images.</p>
<h2 id="somethinghitmeovertheyears2009theveryfirstdesignfortheblog">Somethinghitme over the years - 2009, the very first design for the blog.</h2>
<p><img src="/2023/recreating-this-blog-with-static-generation/images/initial.webp" alt="Initial design" /></p>
<h2 id="2010shtheveryfirstdesignthisonemightbemyfavorite">2010-sh, the very first design (this one might be my favorite).</h2>
<p>Just happened to find this on the wayback machine… I am seriously considering going back to this design.</p>
<p><img src="/2023/recreating-this-blog-with-static-generation/images/2013.webp" alt="2010-ish" /></p>
<h2 id="priortotodaysdesignimadethemsimplerjusttochangethingsup">Prior to todays design, I made them simpler just to change things up.</h2>
<p><img src="/2023/recreating-this-blog-with-static-generation/images/2020.webp" alt="2020" /></p>
<h3 id="2020">2020</h3>
<p>Moving on to 2020 I decided to "upgrade" to Gatsby. There was a bit of hype surrounding it, it used React which I consider myself pretty proficient in, and it generated a static site, exactly what I wanted. This also had the side benefit of allowing me to move hosting to github.</p>
<p>While I found gatsby to be simple for the most part, I just couldn't get over the setup and amount of code needed for something so "simple"… it's something I see everywhere in the development world especially in the front end or Javascript ecosystem. Everything requires a build now.. a build process, multiple dependencies just to get something to show on the page. I went a long with it since the goal was just to convert the site and have some of my older blog posts available. to users.</p>
<p>The issue I had when writing articles most recently is after updating to using Gatsby I found myself spending over an hour or more each time I wanted to add an article since they were so far and few between. I needed to update dependencies to fix issues and of course account for breaking changes. Maybe it's just me, I generally don't run into these issues but Gatsby seemed to always have something going on where the site wouldn't just "build".</p>
<p>In reality all I wanted to do was sit down write up a markdown file and publish it without thinking about the tech behind the solution.</p>
<p>The other thing I started to get annoyed with was the complexity of wrapping my head around how Gatsby used graphQL with the actual markdown files. I found some cases where weird things would happen with excerpts, and simple things such as using pagination on the main page just seemed overly complex.</p>
<h2 id="thesolutionpresent">The Solution - present</h2>
<p>I've been doing a bit of work in node lately (moreso than usual) so came up with a quick and easy plan to get the blog up and running in a state where I could just sit down and create posts. I decided to create a simple node script to generate the entire site from markdown files and json data. This way I could easily write my articles in markdown and not have to worry about the tech behind the scenes.</p>
<p>The solution I feel is pretty simple overall, there's definitely a lot of room for improvement but my goal was to not spend more than a day on the overall solution so I could actually get to the important part of the site, the content.</p>
<p>I decided to host the site publically this time around, all code is located on my github profile <a href="https://github.com/loktar00/somethinghitme2023">here</a>.</p>
<h3 id="thecode">The code</h3>
<p>The articles all live under <code>src/blog</code> and are organized by years, and for the older articles the month and day. The script iterates over the directories grabbing each file and parsing the markdown using <a href="https://www.npmjs.com/package/showdown">showdown</a> (so far 1 of the total 2 dependencies for the site).</p>
<p>I continued to use a similar format I had when using gatsby. At the top of each markdown file there's a section to hold metadata associated with each article. Here's an example for this one.</p>
<pre><code class="markdown language-markdown">title: "Recreating this blog with static generation"
date: "2023-06-15"
teaser: "Something in here"
tags: "blog, javascript, static generation, programming"
</code></pre>
<p>I then parse the markdown when it's being read and extract the information to expose to our templates.</p>
<pre><code class="javascript language-javascript">    // Grab the information from each file to generate our table of contents and structure
    const pattern = /---([\s\S]*?)---/g;
    const matches = text.match(pattern);
    let pageData = {};

    if (matches) {
        for (const match of matches) {
            const contentBetweenDelimiters = match.replace(/---/g, '').trim();
            contentBetweenDelimiters.split('\n')
                .forEach(line =&gt; {
                    const data = line.split(':');
                    const key = data[0].trim();
                    const value = data[1].trim().replace(/"/g, '');
                    pageData[key] = value;
                });
        }
    }
</code></pre>
<h4 id="additionalparsing">Additional parsing</h4>
<p>I do have some <code>gists</code> and quite a few code blocks, so I went with a pretty simple approach of parsing out the code blocks, those are just replaced with prism for syntax highligting.</p>
<p>For gists it's a straight forward approach again, I have considered breaking this out into a sort of "plugin" system to parse out and convert other things, such as prettier images with captions.</p>
<pre><code class="javascript language-javascript">    // Embed gists.
    const gistPattern = /\\\[gist id=(?&lt;id&gt;[\d]*)\\\]/g;
    for (const match of textToConvert.matchAll(gistPattern)) {
        textToConvert = textToConvert.replace(match[0], `&lt;script src="http://gist.github.com/${match.groups.id}.js"&gt;&lt;/script&gt;`);
    }
</code></pre>
<p>For anything else I allow for vanilla markup and scripts so I can just drop in some html if I need to. Since the sites generated I'm not too worried about security.</p>
<h4 id="templating">Templating</h4>
<p>For templating I went with a pretty simple solution, our second dependency is ejs, which I've always been a pretty big fan of.</p>
<p>Here's a quick example of the index page. I use partials for most things duplicated.</p>
<pre><code class="javascript language-javascript">&lt;!DOCTYPE html&gt;
&lt;html lang="en" data-theme="light"&gt;
    &lt;%- include('/src/templates/partials/head', {title: `${data.main.title} - ${data.main.tagline}`}) -%&gt;
    &lt;body&gt;
        &lt;div class="layout"&gt;
            &lt;%- include('/src/templates/partials/header') -%&gt;
            &lt;main class="main"&gt;
                &lt;section class="primary"&gt;
                    &lt;%-
                        data.articles.map(article =&gt;
                            `&lt;a href="/${article.path}"&gt;
                                &lt;article class="article"&gt;
                                    &lt;h3&gt;${article.title}&lt;/h3&gt;
                                    &lt;small&gt;
                                        ${new Date(article.date).toLocaleDateString('en-us', { timeZone: 'UTC', weekday:"long", year:"numeric", month:"short", day:"numeric"})}
                                    &lt;/small&gt;
                                    &lt;p&gt;
                                        ${article.teaser}
                                    &lt;/p&gt;
                                    &lt;footer class="article__footer"&gt;
                                        &lt;span class="read-more"&gt;Read Article →&lt;/span&gt;
                                    &lt;/footer&gt;
                                &lt;/article&gt;
                            &lt;/a&gt;`
                        ).join('')
                    -%&gt;
                &lt;/section&gt;
                &lt;section class="secondary"&gt;
                    &lt;%- include('/src/templates/sidebar', {sidebar: data.sidebar}) -%&gt;
                &lt;/section&gt;
            &lt;/main&gt;
            &lt;%- include('/src/templates/partials/footer') -%&gt;
        &lt;/div&gt;
        &lt;script src='/js/main.js'&gt;&lt;/script&gt;
        &lt;script type='module' src='/js/starscape.js'&gt;&lt;/script&gt;
    &lt;/body&gt;
</code></pre>
<h4 id="otherconfigs">Other configs</h4>
<p>For things like the side bar I follow the approach of creating a few json files to hold the data.</p>
<p>Here's an example of the sidebar json file.</p>
<pre><code class="json language-json">{
    "sidebar": {
        "sections": [
            {
                "title": "Find Me",
                "links": [
                    {
                        "title": "@loktar00",
                        "url": "https://twitter.com/loktar00"
                    },
                    /// Ect.
                ]
            },
            {
                "title": "Projects",
                "links": [
                    {
                        "title": "react-lazy-load",
                        "url": "https://github.com/loktar00/react-lazy-load"
                    },
                  /// Ect.
                ]
            }
        ]
    }
}
</code></pre>
<p>The node script just combines all the JSON together (to include article data from the markdown files), and creates a structure that's passed to the ejs templates to build the page.</p>
<h4 id="styling">Styling</h4>
<p>For styling I'm just using vanilla css, I might change that to SCSS since I'm a huge fan of nesting (I can't wait for the day that's supported natively!).</p>
<h3 id="hosting">Hosting</h3>
<p>For hosting I'm sticking with github pages. Each commit to the main branch triggers an action which builds everything to github pages so I have a pretty worry free experience.</p>
<h3 id="improvements">Improvements</h3>
<p>Beyond just making improvements for mobile, I'm not in love with the main page design when it comes to layout, definitely needs more images. I also do want to go back to a pages main page and need to add tags so I can organize articles in the side bar a bit like I used to with wordpress. Might as well add a timeline as well. As of right now I'm overall happy, not bad for a days worth of work.</p>
<h3 id="conclusion">Conclusion</h3>
<p>Will I end up writing more? Who knows, I feel like I only come to this blog when I don't have an existing project and I want to sink time into something that feels relevant. I've told myself I need to start documenting what I do more in the hopes of helping others however in the back of my mind I wonder how relevant any of this will be with tools like chatGPT. Only time will tell.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Demos and Deviations Project]]></title>
            <link>https://somethinghitme.com/2022/demos-and-deviations/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2022/demos-and-deviations/</guid>
            <pubDate>Mon, 22 Aug 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[I started pulling my scattered demos from places like CodePen and JSFiddle into one repo and gallery. The goal is to keep everything versioned and make it easy to generate previews.]]></description>
            <content:encoded><![CDATA[<p>I've been on a weird archiving kick lately, most recently downloading <em>all</em> of my gog installers for example and storing them locally and on a backup drive. This need or want for archiving spread to my demo's and bits of code I've wrote over the years. I realized a lot of the small projects I found pretty neat were on jsfiddle, codepen, jsbin or dwitter. I decided to copy all of them and put them into a single <a href="https://loktar00.github.io/demos-and-deviations/">project here</a>, <a href="https://github.com/loktar00/demos-and-deviations">source code here</a>.</p>
<p>The idea is to get this project to a point where I can hit a "new demo" button and start coding in the browser like the other solutions out there, with the side benefit of having my changes branched and tracked on github and then automatically generating a video, screenshot or gif and having it up for display. The plan is to use the github api to accomplish the above.</p>
<p>For now however, and in it's current state it's just a nice quick display of the things I've made over the years. This also allows me to lint and fix up some of the demos if I want, however the plan is to for the most part anyway leave them in the state they were in when I created them. I get to see a lot of wonderfully ugly patterns from the past that I don't miss, such as chaining var declarations.</p>
<p><img src="/2022/demos-and-deviations/images/demospage.webp" alt="Demos Page Screenshot" /></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Deep copying in JavaScript]]></title>
            <link>https://somethinghitme.com/2022/deep-copy-in-javascript/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2022/deep-copy-in-javascript/</guid>
            <pubDate>Wed, 27 Apr 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Deep copying in JavaScript is a mess if you do not know the tradeoffs. This post covers shallow vs deep copies, where JSON stringify and spread/Object.assign break down, and when structuredClone is the right tool.]]></description>
            <content:encoded><![CDATA[<h2 id="deepcopyingcloninginjavascript">Deep copying / cloning in JavaScript</h2>
<p><strong>tldr; structuredClone</strong></p>
<h3 id="copyingbyvalueorreference">Copying by value or reference</h3>
<p>Before we talk about deep cloning let's take a step back and talk about passing by value or by reference. Quick explanation, copying by value assigns the data to a new memory address, whereas copying by reference just points to the memory address which has the original value.</p>
<p><strong>Example of a primitive type in JavaScript being copied by value:</strong></p>
<pre><code class="javascript language-javascript">let a = 'Hello!';
const b = a;

a = 'Bye!'

console.log(b) // Hello!
</code></pre>
<p>Primitive types copied by value:  string, number, boolean, undefined, null,</p>
<p><strong>Example of a type being copied by reference:</strong></p>
<pre><code class="javascript language-javascript">let a = [1, 2, 3, 4];
const b = a;

a[0] = 'first index in the array!';

console.log(b) // ['first index in the array!', 2, 3, 4]

let foo = { prop: 123 };
let bar = foo;

foo.prop = 456;

console.log(bar); // 456
</code></pre>
<p>The above will happen with object, array, and function</p>
<h2 id="deepcopyinginjsonlyskindeep">Deep copying in JS only skin deep</h2>
<p>JavaScript will only naturally deep copy 1 level deep, and only the primitive types mentioned above.</p>
<p><strong>Deep copy, by value when one level deep:</strong></p>
<pre><code class="javascript language-javascript">let a = [1, 2, 3, 4];

// a.map(el =&gt; el), a.forEach(el =&gt; b.push(el));
const b = [...a];

a[0] = 'first index in the array!';

console.log(b) // ['first index in the array!', 2, 3, 4]

let foo = {prop: 123};
let bar = {...foo}; //Object.assign({}, foo);

foo.prop = 456;

console.log(bar); // {prop: 123}
</code></pre>
<p>For example an array one level deep containing objects property will still be shallow copies.</p>
<p><strong>Shallow copy once we introduce objects:</strong></p>
<pre><code class="javascript language-javascript">let a = [{a:1}, {b:2}, {c:3}];
const b = [...a]; // a.map(el =&gt; el);

a[0].a = 'first index in the array!';

// [{"a":"first index in the array!"}, {"b":2}, {"c":3}]
console.log(b)
</code></pre>
<p>This means once our data structure introduces any nesting (arrays, objects or functions) we're back to a shallow copy of the data.</p>
<p><strong>Shallow copy once we introduce nested value:</strong></p>
<pre><code class="javascript language-javascript">let a = [[1, 2, 3], 2, 3];
const b = [...a];

a[0][0] = 'first index in the array!';

// [["first index in the array!", 2, 3], 2, 3]
console.log(JSON.stringify(b))
</code></pre>
<h3 id="howcanwefixthis">How can we fix this?</h3>
<p>So now that we've established how it works what can we do about it?</p>
<p>You'll find various solutions online from over the years, solutions which include recursively traversing the data structures and copying each element such as below just for this demo. While they work they're not always performant and commonly have issues.</p>
<p><strong>Random utility to deep copy an array:</strong></p>
<pre><code class="javascript language-javascript">// Don't use this!
function deepCopy(arr, result) {
  for (let el of arr) {
    if (Array.isArray(el)) {
      result.push(deepCopy(el, []));
    } else {
      result.push(el);
    }
  }

  return result;
}

let a = [[7, 8, 9, [10, 11]], 2, 3];
const b = [...a];
const c = deepCopy(a, []);

a[0][0] = 'first index in the array!';
console.log(b); // [["first index in the array!",8,9,[10,11]],2,3]
console.log(c); // [[7,8,9,[10,11]],2,3]
</code></pre>
<h3 id="jsonstringifytotherescue">JSON.stringify to the rescue?</h3>
<p>What if we could type cast all of our values to a string and read them back in? That’s exactly what JSON.stringify does for us. It's become the defacto method of deep copying.. so much in fact browser vendors have spent extra time making it more performant over the years.</p>
<pre><code class="javascript language-javascript">let a = [[7, 8, 9, [10, 11]], 2, 3];
const b = [...a];
const c = JSON.parse(JSON.stringify(a));

a[0][0] = 'first index in the array!';
console.log(b); // [["first index in the array!",8,9,[10,11]],2,3]
console.log(c); // [[7,8,9,[10,11]],2,3]
</code></pre>
<p>It works, we're done!… well not so fast. The JSON.stringify method while fast and gets us most of the way there still has some pretty significant drawbacks.</p>
<p><strong>Example using a Map and Date</strong></p>
<pre><code class="javascript language-javascript">const map = new Map();
map.set('a', 1);

let date = new Date();

let a = [0, 1, {c: map}, date];
// [0, 1, {c:{}}, '2022-04-07T22:15:09.947Z']
const b = JSON.parse(JSON.stringify(a));
</code></pre>
<p>Notice how our Map is now just an empty object, in addition since the data is "stringified" and parsed we get the actual value for Date rather than access to the date object itself. This also of course applies to Set, and regex values as well.</p>
<h3 id="introducingstructuredclonetotherescuemostly">Introducing structuredClone() to the rescue (mostly)</h3>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/structuredClone#syntax">Usage from MDN.</a></p>
<pre><code class="javascript language-javascript">structuredClone(value)
structuredClone(value, { transfer })
</code></pre>
<p>This simplifies almost everything for us.</p>
<p><strong>The same example from above with structuredClone:</strong></p>
<pre><code class="javascript language-javascript">const map = new Map();
map.set('a', 1);

let date = new Date();

let a = [0, 1, {c: map}, date];
const b = JSON.parse(JSON.stringify(a));
const c = structuredClone(a);
a[1] = 2;

// [0, 1, {c:{}}, '2022-04-07T22:15:09.947Z']
console.log(b);

// [0, 1,
//  {{c: Map(1)},
//  Thu Apr 07 2022 18:15:17 GMT-0400 (Eastern Daylight Time)
// ]

console.log(c);

c[3].getDate() + 5 // Current date + 5 returns the result

// Can't do this since it's just a string.
// Uncaught TypeError: b[3].getDate is not a function
b[3].getDate() + 5
</code></pre>
<h3 id="caveatsofstructuredclone">Caveats of structuredClone</h3>
<p>There's only one real issue currently that affects all the methods above, functions and dom elements.</p>
<p>Functions error</p>
<pre><code class="javascript language-javascript">let a = [0, 1, {c: () =&gt; true} ];
// Uncaught DOMException:
// Failed to execute 'structuredClone' on 'Window'
const c = structuredClone(a);
</code></pre>
<p>As long as you’re aware of the caveats (which are generally small edge cases in our data) structuredClone is the recommended approach for deep copying data within JavaScript. It’s a first class citizen and removes some hacks and using JSON parsing which has always felt like a hack.</p>
<p>I definitely recommend reading the link above to <a href="https://2ality.com/2022/01/structured-clone.html">2ality</a> on further caveats and a fantastic in depth description into structuredClone which goes much further than the MDN article.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Floating text from cursor generative demo]]></title>
            <link>https://somethinghitme.com/2022/float-text-from-cursor/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2022/float-text-from-cursor/</guid>
            <pubDate>Thu, 31 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[A quick JS/CSS experiment where text trails the cursor, inspired by a tweet. I fed it a random Nostradamus paragraph and called it a nice little deviation.]]></description>
            <content:encoded><![CDATA[<p>Came across <a href="https://twitter.com/patakk/status/1501901438674419722">this tweet</a> inspired me to try my hand at it with JS/CSS. Grabbed some random paragraph from Nostradamus, turned out to be a nice little deviation.</p>
<iframe height="300" style="width: 100%;" scrolling="no" title="Floating text from cursor" src="https://codepen.io/loktar00/embed/OJzjLOr?default-tab=result&editable=true" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href="https://codepen.io/loktar00/pen/OJzjLOr">
  Floating text from cursor</a> by Loktar (<a href="https://codepen.io/loktar00">@loktar00</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Simple One Element Toggle]]></title>
            <link>https://somethinghitme.com/2021/simple-one-element-toggle/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2021/simple-one-element-toggle/</guid>
            <pubDate>Sat, 23 Oct 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[A minimal toggle built from a single checkbox input. It is pure CSS using pseudo-elements for the track and thumb, so it drops into a form without extra markup.]]></description>
            <content:encoded><![CDATA[<iframe height="300" style="width: 100%;" scrolling="no" title="Simple 1 element CSS toggle" src="https://codepen.io/loktar00/embed/RwZpBab?default-tab=css%2Cresult&editable=true" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href="https://codepen.io/loktar00/pen/RwZpBab">
  Simple 1 element CSS toggle</a> by Loktar (<a href="https://codepen.io/loktar00">@loktar00</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>Needed a pretty quick toggle for a project I was working on, definitely could have copied one of the hundreds of toggles out there that exist, but what's the fun in that?</p>
<p>The main purpose was to allow it to be used as a checkbox with a single element requiring no extra elements or correct placement of container or child elements.</p>
<pre><code class="html language-html">&lt;input type="checkbox" class="toggle"&gt;
</code></pre>
<p>All of the magic is of course in the CSS.</p>
<pre><code class="css language-css">.toggle {
  --size: 1.125rem;
  --width: calc(1.125rem * 2);
  display: inline-grid;
  align-items: center;
  width: var(--width);
  height: var(--size);
  cursor: pointer;
}

.toggle::before {
  content: "";
  grid-area: 1 / -1;
  width: var(--width);
  height: var(--size);
  transition: all 250ms ease;
  border-radius: var(--width);
  background-color: #000;
}

.toggle:hover::before {
  box-shadow: 0 0 0 2px #aef;
}

.toggle::after {
  content: "";
  grid-area: 1 / -1;
  width: calc(var(--size) * 0.8);
  height: calc(var(--size) * 0.8);
  transform: translateX(10%);
  transform-origin: center center;
  transition: all 250ms ease;
  border-radius: 100%;
  background: #fff;
}

.toggle:checked::before {
  background-color: #2be;
}

.toggle:checked::after {
   transform: translateX(calc(var(--width) - var(--size) * 0.8 - 10%));
}

.toggle:disabled {
  pointer-events: none;
  filter: grayscale(1);
}

.toggle:disabled::before {
   background: #2be;
}
</code></pre>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Extracting the subdomain with node.js]]></title>
            <link>https://somethinghitme.com/2014/07/25/extracting-the-subdomain-with-nodejs/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2014/07/25/extracting-the-subdomain-with-nodejs/</guid>
            <pubDate>Fri, 25 Jul 2014 00:00:00 GMT</pubDate>
            <description><![CDATA[A simple Express pattern for reading the host header, pulling out the subdomain, and normalizing hyphens so you can drive behavior off `whatever.yourdomain.com with` a wildcard DNS entry.]]></description>
            <content:encoded><![CDATA[<p>Years ago I made some novelty sites with php/apache that used the subdomain to display different messages to the user, I decided to remake one of them using node and wanted to share how this could be done, it was much simpler than I thought it would be.</p>
<p>For this I used <a href="http://expressjs.com/">express</a>, you could do it without pretty easily but express makes it so simple easy to get everything off the ground running. Once you install express you just need to update your routes/index.js to the following.</p>
<pre><code class="javascript language-javascript">exports.index = function(req, res){
    var domain = req.headers.host, subDomain = domain.split('.');

    if (subDomain.length &gt; 2) {
        subDomain = subDomain[0].split("-").join(" ");
    } else {
        subDomain = "Everyone ";
    }

    res.render('index', { subDomain: subDomain }); };
</code></pre>
<p>It's pretty self explanatory but I'll go through it regardless. First we grab the domain host from the request headers, then we do a split on the period this will give us the subdomain and the domain. So a request such as</p>
<blockquote>
  <p>bob.everyonelovesyou.com</p>
</blockquote>
<p>should give us</p>
<pre><code class="javascript language-javascript">    ['bob', 'everyonelovesyou']
</code></pre>
<p>We only care about bob, so if we have the subdomain we split any hyphens and then rejoin with a space so phrases can be passed in such as</p>
<blockquote>
  <p>seriously-bob.everyonelovesyou.com</p>
</blockquote>
<p>and it will become</p>
<blockquote>
  <p>'seriously bob'</p>
</blockquote>
<p>We then just need to pass this to the view so they can be accessed. &nbsp;I use ejs so I can access the subDomain in the view like so</p>
<pre><code class="html language-html">&lt;%= subDomain %&gt;
</code></pre>
<p>The final step is to make sure set a wildcard cname for your domain like the following</p>
<p>*.yourdomain.com</p>
<p>So you can catch all the incoming subdomains. <a href="http://some-text.fuckinghatesyou.com">And here&nbsp;is an example of a site in action</a></p>
<p><a href="https://github.com/loktar00/effinhatesyou">You can get the code from the above site from github</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Rift Enabled Canvas Demo]]></title>
            <link>https://somethinghitme.com/2014/03/18/rift-enabled-canvas-demo/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2014/03/18/rift-enabled-canvas-demo/</guid>
            <pubDate>Tue, 18 Mar 2014 00:00:00 GMT</pubDate>
            <description><![CDATA[I ported my canvas tunnel demo to the Oculus Rift using oculus-bridge and a CSS shader warp. It renders a canvas per eye and keeps the canvas small enough to work within Chrome's filter limits.]]></description>
            <content:encoded><![CDATA[<p><img src="/2014/03/18/rift-enabled-canvas-demo/images/nww4NBm.webp" alt="" /></p>
<p>I have neglected to write for a while, have worked at 3 different jobs since my last post and things have finally settled down. I figured I would start back up with something pretty simple I did tonight.</p>
<p>My son was <a href="http://codepen.io/loktar00/pen/Alqkb">looking at my tunnel of doom demo</a>&nbsp;and said it would be awesome on the Oculus Rift. So I figured I would try porting it. After a quick search I came across the <a href="https://github.com/Instrument/oculus-bridge/">oculus bridge project</a>. The thing that interested me most was the CSS demo which uses some shaders to warp the screen for the rift. All I needed to do was add a canvas into each eye and I had a rift enabled demo.</p>
<p>There is one drawback currently chrome doesn't support filters for accelerated layers so I had to keep my canvas size down in order for it to work, but with some up-scaling the <a href="http://codepen.io/loktar00/pen/gpuLE">effect turned out pretty cool</a>.</p>
<p><img src="/2014/03/18/rift-enabled-canvas-demo/images/mFdZScK.webp" alt="Rift Enabled Tunnel" /></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Game Dev Movement cheatsheet with examples]]></title>
            <link>https://somethinghitme.com/2013/11/13/snippets-i-always-forget-movement/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/11/13/snippets-i-always-forget-movement/</guid>
            <pubDate>Wed, 13 Nov 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[This is my movement cheat sheet for 2D games, with runnable examples. It covers distance checks, angle math, pursuit, projecting points (like gun barrels), rotation while moving, and Asteroids-style heading movement with friction.]]></description>
            <content:encoded><![CDATA[<h4 id="akamycheatsheetofhelpfulcode">aka My Cheat Sheet of Helpful Code</h4>
<p>I created <a href="http://www.somethinghitme.com/2010/04/26/game-related-snippets-i-always-forget/" title="Game Related Snippets I always Forget">a blog post way back</a> title Game Snippets I Always Forget. I put it up basically as a dumping ground for random game related bits of code I found myself looking up over.. and over. A few of them are a bit cryptic but that's mostly due to me quickly logging in and pasting before I'd forget. While now I have (most) memorized I figured I would revisit the article and add some examples that may help others out. The following are examples dealing with movement, angles, and directions.</p>
<p>As a disclaimer I am not claiming to be an expert in this, I’m sure there are better ways to do some of these and if there are feel free to comment and let me know.</p>
<h4 id="distancecheck">Distance Check</h4>
<p>This one is obviously very important in any sort of game development. What I find myself using it for most is quick collision checks. However its used in many cases, an example found later in this article.</p>
<pre><code class="javascript language-javascript">var x = x2 - x1,
    y = y2 - y1,
    distance = Math.sqrt(x * x + y * y);
</code></pre>
<iframe style="width: 500px; height: 600px;" src="https://jsfiddle.net/loktar/eYw5b/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<h4 id="movetowardsanobjectwitheasing">Move Towards an Object With Easing</h4>
<p>This can be useful for inertia based mouse movement. This moves an object to the designated target, making it move slower the closer it gets to the target.</p>
<pre><code class="javascript language-javascript">x += (targetX-x)/speed;
y += (targetY-y)/speed;
</code></pre>
<iframe style="width: 500px; height: 500px;" src="https://jsfiddle.net/loktar/RE7Ac/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<h4 id="movetowardsanobjectataconstantspeed">Move Towards an Object at a Constant Speed</h4>
<p>The next bit of code can be used for any type of following behavior. The difference from the example above is that the object will move towards its target at a constant speed rather than easing its way there.</p>
<pre><code class="javascript language-javascript">var tx = targetX - x,
    ty = targetY - y,
    dist = Math.sqrt(tx * tx + ty * ty);

velX = (tx / dist) * thrust;
velY = (ty/dist) * thrust;
</code></pre>
<iframe style="width: 500px; height: 500px;" src="https://jsfiddle.net/loktar/x5KHT/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<h4 id="gettheanglebetweenobjectsandprojectapointinfrontoftheobject">Get the Angle Between Objects and Project a Point in Front of the Object</h4>
<p>Its important to note the above example does not include the facing direction in order to get that we need to know what the angle is between both objects.</p>
<pre><code class="javascript language-javascript">var x = this.x - this.targetX,
    y = this.y - this.targetY,
    radians = Math.atan2(y,x);
</code></pre>
<p>Now that we know how to get the angle between two objects we can project a point in front of it. This can be used for positioning a gun, or for the start position of projectiles. Since realistically bullets shouldn’t necessarily come from the center of our object.</p>
<pre><code class="javascript language-javascript">pointx = x + pointLength * Math.cos(radians);
pointy = y + pointLength * Math.sin(radians);
</code></pre>
<iframe style="width: 500px; height: 650px;" src="https://jsfiddle.net/loktar/KAa2J/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<h4 id="movetowardsanotherobjectwithproperrotation">Move Towards Another Object With Proper Rotation</h4>
<p>We can combine the two above samples and now move an object towards another with the correct facing angle. This is obviously beneficial for many reasons.</p>
<iframe style="width: 500px; height: 500px;" src="https://jsfiddle.net/loktar/R6RMp/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<h2 id="puttingsomeinformationtogooduse">Putting Some Information to Good Use</h2>
<p>I assume you will find ways to use this, maybe you already have and just stumbled across this article to take a piece of code, but I wanted to throw an example or two in here just in case. The following is a quick example of how to do simple predefined pathing for tower defense enemies.</p>
<iframe style="width: 500px; height: 600px;" src="https://jsfiddle.net/loktar/cSHmG/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p>Just by using the code so far in this article you could add towers that shoot, &nbsp;and implement basic collision, having most of whats needed for a very simple tower defense.</p>
<h4 id="moveanobjectbasedonitsheading">Move an Object Based on its Heading</h4>
<p>The last movement example is moving based on the current heading. Meaning moving towards the angle you are facing. The angle can be a target angle, or one set by the user via the arrow keys for example. This is achieved by using the following</p>
<pre><code class="javascript language-javascript">velX = Math.cos(currentAngle) * thrust;
velY = Math.sin(currentAngle) * thrust;
</code></pre>
<p>However if you want a movement style similar to asteroids you can use this instead.</p>
<pre><code class="javascript language-javascript">velX += Math.cos(currentAngle) * thrust;
velY += Math.sin(currentAngle) * thrust;
</code></pre>
<p>You will most likely want to set the thrust to a lower number in the above example since you are adding it each time rather than setting it once.&nbsp;One tip if you are using Asteroids style movement is to apply friction or your object will go on forever. This is easily done by doing the following way.</p>
<pre><code class="javascript language-javascript">velX *= 0.98;
velY *= 0.98;
</code></pre>
<p>Note you can use any value less than one to apply friction the lower the number the faster you will glide to a stop.</p>
<p>Regardless of the type of motion you choose you then apply the velocities to your object.</p>
<pre><code class="javascript language-javascript">this.x -= this.velX;
this.y -= this.velY;
</code></pre>
<p>And here is a finished example showing the Asteroids style movement.</p>
<iframe style="width: 500px; height: 650px;" src="https://jsfiddle.net/loktar/3M6Fa/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p>I hope you find this information useful. &nbsp;All of the major pieces of the code needed to make many types of games are included in this post. One example where I have personally used the above information is on <a href="http://retroships.com">Retroships.com</a>&nbsp;among many other projects I have worked on.</p>
<p>I’m considering doing another post on a few random bits of code I find myself using often, check back soon!.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Simple 2d Terrain With Midpoint Displacement]]></title>
            <link>https://somethinghitme.com/2013/11/11/simple-2d-terrain-with-midpoint-displacement/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/11/11/simple-2d-terrain-with-midpoint-displacement/</guid>
            <pubDate>Tue, 12 Nov 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[A practical walkthrough of midpoint displacement (Diamond Square) for 2D canvas terrain. It explains the iterations, how roughness changes the look, and includes a JS implementation with notes on wrapping and scrolling.]]></description>
            <content:encoded><![CDATA[<p><a href="http://codepen.io/loktar00/details/uEJKl"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/ter.webp" alt="Codepen terrain" /></a></p>
<p align="center">
Screenshot from scrolling terrain and shooting stars demo on codepen.io
</p>
<p>In a few of my demos I've used 2d terrain. I love the effect and its really easy to do especially in 2d. The algorithm I use most is Diamond Square also known as Midpoint Displacement. What's great about the algorithm besides its easy of use is that it can be used for simple 2d terrain as well as with 3d terrain. For now I will just be talking about generating 2d terrain, in a future article I will discuss how to use the same algorithm to make create height maps that can be used in turn to create 3d terrain.</p>
<p>I'm going to use JavaScript and the canvas element for my examples but the principles can easily be applied to any language or rendering technology.</p>
<p>The method I will be describing is midpoint displacement. Its one of the simplest algorithms in my opinion when it comes to making good looking 2d procedural terrain.</p>
<h2 id="abriefoverviewofhowitworks">A Brief Overview of How it Works</h2>
<p>For Each Segment
    Divide in half and average the middle point
        add a random value to the mid point
        reduce the random range
    Repeat Until segments are too small to continue.</p>
<h2 id="amoreindepthexplanation">A More in Depth Explanation</h2>
<p>First we assign a random value to the outer edges of our terrain. This can be anything from 0-1 or 50-100. The value itself is dependant on the system you want to use for plotting. We then need to get the center point of the segment. Once we have the center we calculate its value by averaging the two points and adding a random value to it.</p>
<p>&nbsp;<a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/fig1.png"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/fig1.webp" alt="fig1" /></a></p>
<p>So now that we have our 3 starting points we move onto the next step. The next step is exactly the same as above. As you can see we have 2 segments, so we get the center of each segment and add the average of its edges plus a random amount. We then need reduce our random range for the next iteration.</p>
<p>&nbsp;<a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/fig2.png"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/fig2.webp" alt="fig2" /></a></p>
<p>Now we have four segments so all we need to do is cut each segment in half again, average the center values add our random value and reduce the random range.</p>
<p>&nbsp;<a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/fig3.png"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/fig3.webp" alt="fig3" /></a></p>
<p>As you can see the more iterations creates more realistic terrain. Lately it seems like none of my articles can be complete without an animated gif, so here is one animating the process.</p>
<p>&nbsp;<a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/output_WRacb0.gif"><img src="images/output_WRacb0.gif" alt="output_WRacb0" /></a></p>
<h2 id="howmuchdoireducetherandomrange">How much do I reduce the random range?</h2>
<p>From now on I’ll call this roughness. How much do you need to reduce it by each iteration? Well that all depends on how you want your end result to look. The greater the reduction the less jagged your hill’s will be. So if you want more of a rolling hill appearance you would to reduce the value at least by half every iteration, however if you want more jagged mountains you don’t want to reduce the value very much at all. Below is an example of terrain using two different values for roughness.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/point5.png"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/point5.webp" alt="point5" /></a> Created by using a value of 0.5</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/point7.png"><img src="/2013/11/11/simple-2d-terrain-with-midpoint-displacement/images/point7.webp" alt="point7" /></a> Created by using a value of 0.7
The following JavaScript function is what I used to create the above examples.</p>
<pre><code class="javascript language-javascript">/*
  width and height are the overall
  width and height we have to work with, displace is
  the maximum deviation value.
  This stops the terrain from going out of bounds if we choose
*/

function terrain(width, height, displace, roughness){
    var points = [],
        // Gives us a power of 2 based on our width
        power = Math.pow(2, Math.ceil(Math.log(width) / (Math.log(2))));

    // Set the initial left point
    points[0] = height/2 + (Math.random()*displace*2) - displace;
    // set the initial right point
    points[power] = height/2 + (Math.random()*displace*2) - displace;
    displace *= roughness;

    // Increase the number of segments
    for(var i = 1; i &lt; power; i *=2){
        // Iterate through each segment calculating the center point
        for(var j = (power/i)/2; j &lt; power; j+= power/i){
            points[j] = ((points[j - (power / i) / 2] + points[j + (power / i) / 2]) / 2);
            points[j] += (Math.random() * displace*2) - displace
        }
        // reduce our random range
        displace *= roughness;
    }
    return points;
</code></pre>
<iframe style="width: 540px; height: 300px;" src="https://jsfiddle.net/loktar/5Xdzg/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p>In my code I also use a value called displace. This is just to control the maximum distance a point can go this is so I can keep it inside of the canvas area.</p>
<h2 id="wrappingterrainandscrolling">Wrapping Terrain and Scrolling</h2>
<p>Using this algorithm makes it easy to create wrapping terrain, in order to do so you just set the two initial starting points to the same value.</p>
<p>There are a few ways to create scrolling terrain. In my codepen for example I cheat and just pop and push the points on the array itself which makes the wrapped terrain scroll. However a better approach in my opinion is to use two sets of values and just move them based on an offset. Once the second half reaches the edge of the screen reset the offset to 0 copy the second array to the first, and generate new terrain for the second array, passing in the seed. Below is a fiddle of how I personally achieve the effect.</p>
<iframe style="width: 540px; height: 300px;" src="https://jsfiddle.net/loktar/XDpd3/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p>Well that was a lot of information. Would you believe there is an even simpler method to creating 2d terrain than that? I'll go over that in my next article.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Burn Away Effect Explanation]]></title>
            <link>https://somethinghitme.com/2013/11/07/burn-away-effect-explanation/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/11/07/burn-away-effect-explanation/</guid>
            <pubDate>Thu, 07 Nov 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[A simple burn-away effect using pixel "fuel". I build a 2D grid of burn values, decrement neighbors as pixels burn out, and use step-based flags to keep the spread controlled, with an optional flame coloring pass..]]></description>
            <content:encoded><![CDATA[<p>This explanation doesn't show any code more of just an overview of how to achieve a simple but cool looking effect.</p>
<p>I've seen variations this effect used in different places, one of the more recent examples I can think of is the loading screens from Red Orchestra 2. RO2's effect definitely uses a different method than mine but it gave me an idea to try something similar. I ended up with a similar effect using pixel manipulation, and a tiny bit of Cellular Automaton.</p>
<p><a href="http://cdpn.io/kriFg" title="Burn Away Effect on Codepen">This is what I ended up with.</a>&nbsp;(heh yeah I'm a huge Spartacus fan)</p>
<p><a href="http://codepen.io/loktar00/pen/kriFg">Edit view with code</a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/effect.png"><img src="/2013/11/07/burn-away-effect-explanation/images/effect.webp" alt="effect" /></a></p>
<h2 id="howtheeffectworks">How the effect works</h2>
<p>The explanation of the effect is really simple. I basically thought of each pixel as fuel. &nbsp;So to determine how long each pixel should “burn” we create a 2D array where each element represents a pixels fuel value we do this by assigning a random value.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/1.png"><img src="/2013/11/07/burn-away-effect-explanation/images/1.webp" alt="1" /></a></p>
<p>The effect works by decrementing the value of all elements which neighbor an element whose value is 0. So to start the effect we need to set an element's value to 0.</p>
<p>There is one gotcha to be aware of. If you don’t have someway of flagging elements whose value has been changed in the current cycle you will end up with a burn effect that goes very fast, and also tends to go to the right or left depending on how you loop through the elements. This speed issue is due to the fact that some elements will have more than one neighbor whose value is 0, in that case we still only want to reduce the value once.</p>
<h2 id="animationoftheeffectinprogress">Animation of the effect in progress</h2>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/11/output_WPd1vJ.gif"><img src="images/output_WPd1vJ.gif" alt="output_WPd1vJ" /></a></p>
<p>If you want to add a cool effect to make it look like a flame or possible something is eating the elements you just need to color the elements that neighbor an element whose value is 0, as seen in my demo with the color option.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Working on a new JS game]]></title>
            <link>https://somethinghitme.com/2013/10/10/working-on-a-new-js-game/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/10/10/working-on-a-new-js-game/</guid>
            <pubDate>Thu, 10 Oct 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[A progress post on Grapple Hero, an HTML5 canvas game where the only movement is grappling. It includes screenshots, a playable demo build, and what I planned to do next.]]></description>
            <content:encoded><![CDATA[<p>I've been furloughed from my job (government contractor) so I've had a bit of free time on my hands the last 2 weeks. I decided to start and hopefully in a reasonable amount of time finish a full fledged html5/canvas game.</p>
<p>The name of the game is Grapple Hero, check out a few of the wip screenshots.</p>
<p><a href="http://media.indiedb.com/cache//2013/10/10/working-on-a-new-js-game/images/games/1/27/26609/thumb_620x2000/levelselect.webp"><img src="/2013/10/10/working-on-a-new-js-game/images/levelselect.webp" alt="levelselect" /></a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/10/grapple-hero.png"><img src="/2013/10/10/working-on-a-new-js-game/images/grapple-hero.webp" alt="grapple hero" /></a><a href="http://media.indiedb.com/cache//2013/10/10/working-on-a-new-js-game/images/games/1/27/26609/thumb_620x2000/grasstiles.webp""><img src="/2013/10/10/working-on-a-new-js-game/images/grasstiles.webp" alt="grasstiles" /></a></p>
<p><a href="http://media.indiedb.com/cache//2013/10/10/working-on-a-new-js-game/images/games/1/27/26609/thumb_620x2000/menu_progress.webp"><img src="/2013/10/10/working-on-a-new-js-game/images/menu_progress.webp" alt="menu progress" /></a></p>
<p>If anyone has played my old <a href="http://js1k.com/2010-first/demo/755">js1k entry</a> &nbsp;you'll recognize the game play immediately. Your character cannot move any way but using his grapple. Once your grapple makes a connection you are shot up into the air where you need to grapple again or you'll fall (sometimes to your death). <a href="http://grapplehero.com/">I created a website for the game</a> &nbsp;where you can play the most current demo build, which involves you trying to escape from lava.</p>
<p>I plan on releasing it on Windows, Linux, as a standalone executable, on Android via cacoonjs, on the Google app store, and Desura (hopefully).</p>
<p>Its also been added to IndieDB check it out :)</p>
<p><a href="http://www.indiedb.com/games/grapple-hero" title="Grapple Hero Windows, Linux, Web, Mobile, Android, MetroTab game"><img src="/2013/10/10/working-on-a-new-js-game/images/indiedb_88x31.webp" alt="Grapple Hero Windows, Linux, Web, Mobile, Android, MetroTab game" /></a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Recreating gifs for the jsBin Compo]]></title>
            <link>https://somethinghitme.com/2013/08/18/recreating-gifs-for-the-jsbin-compo/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/08/18/recreating-gifs-for-the-jsbin-compo/</guid>
            <pubDate>Mon, 19 Aug 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[I recreated a handful of math-y GIFs for the JSBin birthday competition and wrote up the results with demos. This covers a wavy pattern, a crosshatch switch, a P-wave/compression wave, and a "rough seas" variant.]]></description>
            <content:encoded><![CDATA[<p>There's a really interesting <a href="http://remysharp.com/2013/08/14/jsbin-5th-birthday/">competition the creator of jsbin is running</a>. The competition involves recreating some pretty amazing gifs (mostly mathematical based) using Javascript, CSS, and HTML.&nbsp;I couldn't help but try my hand at a few of the gifs. As of this writing I have successfully (mostly anyway) reproduced four of the images.</p>
<h2 id="waveygif">Wavey gif</h2>
<p><img src="images/waves.gifv" alt="" /></p>
<p><a href="http://jsbin.com/otusog/2/">Wavey gif Demo</a></p>
<h2 id="crazycrosshatchswitchinggif">Crazy Crosshatch Switching gif</h2>
<p><a href="http://jsbin.com/akorem/5/">Crazy Crosshatch Switching Demo</a></p>
<h2 id="pwavecompressionwave">P-Wave/Compression Wave</h2>
<p><img src="images/NEOCVPW.gif" alt="" /></p>
<p><a href="http://jsbin.com/ojiwex/2/">P-Wave/Compression Wave Demo</a></p>
<p>Finally my favorite and the one I did the most work on so far</p>
<h2 id="roughseas">Rough Seas</h2>
<p><img src="images/9uGXXpb.gif" alt="" /></p>
<p><a href="http://jsbin.com/oFoZaJe/1/embed?live">JS Bin</a></p>
<script type="text/javascript" src="http://static.jsbin.com/js/embed.js"></script>
<p>I'm sure I'll try my hand at a few more before the competition is over. But I might need to take a break after the last one, it was pretty tough.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[3d Shading with Points]]></title>
            <link>https://somethinghitme.com/2013/08/16/3d-shading-with-points/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/08/16/3d-shading-with-points/</guid>
            <pubDate>Sat, 17 Aug 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[Recreating a shaded-sphere effect using nothing but points on canvas. I break down the math (row width via Pythagoras), how the random threshold creates shading, and how a single divisor changes the look.]]></description>
            <content:encoded><![CDATA[<p>I was checking out some old books the other day and I came across Commodore Step by Step Graphics Vol 3. It had an interesting looking screenshot for a bit of code, which showed shaded spheres entirely made of points. I thought the effect would look cool if multiple ones were layered over each other to look like planets and moons. So I converted the Basic over to JavaScript using the canvas element to replicate the effect.</p>
<p>This is what is produced with the code.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/08/Planets-with-points-CodePen.png"><img src="/2013/08/16/3d-shading-with-points/images/Planets-with-points-CodePen.webp" alt="Planets with points - CodePen" /></a></p>
<p>So how exactly is this effect achieved?</p>
<p><a href="http://cdpn.io/zEhDB">Full page result on codepen</a></p>
<p>The following function is what's used to generate the planets.</p>
<pre><code class="javascript language-javascript">function drawPlanet(rad, xc, yc, color) {
    color = color || { r: 0, g: 100, b: 160 };
    ctx.fillStyle = "#000"; ctx.beginPath();
    ctx.arc(xc, yc, rad, 0, Math.PI \* 2);
    ctx.fill();
    ctx.closePath();

    ctx.fillStyle = `rgb(${color.r},${color.g},${color.b})`;

    var x1 = parseInt(Math.sqrt(rad * rad - y * y));
    for (var x = -x1; x &lt; x1; x++) {
        var n = parseInt(Math.random() * x1) / 1.5;
        if (n &gt; x1 + x) {
            ctx.fillRect(x + xc, y + yc, 1, 1);
        }
    }
}
</code></pre>
<p>The function drawPlanet takes four parameters. Radius, center x, center y, and the color of the planet. First a solid black arc is created so we can get a proper layering effect, otherwise dots would bleed through and the planets would blend together.</p>
<p>The loop from -rad to rad is where everything takes place. Each iteration as we go down the circle we find out how long the row is from the center x and y position to the edge of the circle. Thanks to <a href="https://twitter.com/yutt">@yutt</a> for pointing me in the right direction.</p>
<p>We have two points to go from, our Radius (center point), and the Y. So using Pythagoras Theorem (a^2 + b^2 = c^2) we have a and c we can figure out b.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/08/radfig1.png"><img src="/2013/08/16/3d-shading-with-points/images/radfig1.webp" alt="radfig1" /></a></p>
<p><a href="http://jsfiddle.net/loktar/yJhLu/">Try the fiddle out to see how it works.</a></p>
<p>We have the point from radius, radius+y to the edge of the circle. Now we are able to iterate from -x to x and get every pixel between the edges of the circle for this row.</p>
<p>Now that we had the width of the row we’re on and can iterate over each pixel, the next step is to determine what pixels we want to show and what pixels we want hidden. That is done in the following section of the function drawPlanet.</p>
<pre><code class="javascript language-javascript">    for (var x = -x1; x &lt; x1; x++) {
        var n = parseInt(Math.random() * x1) / 1.5;
        if (n &gt; x1 + x) {
            ctx.fillRect(x + xc, y + yc, 1, 1);
        }
    }
</code></pre>
<p>The variable n stores a random number between 0 and x1. Next to determine if we plot the point we check if n is greater than x1 + x. So points would only be plotted if n is greater than x+x1 meaning x *has* to cross the barrier, making it more likely points are plotted towards the end of our loop since x would be getting closer to x1 x+x1 would almost be double x1 making it very likely points will be ploted. If we just stopped there we would get a cool effect. Pixels would be randomly plotted for half of the planet. That is where the example in the commodore book ended. However I wanted to get a more spherical effect. All that we need to do for that is divide the value a bit.</p>
<pre><code class="javascript language-javascript">    var n = parseInt(Math.random() * x1) / 1.5;
</code></pre>
<p>I use a default of 1.5 what this does is decreases our random number generated even further making it less likely to plot points farther from the edge. And since the value of x1 follows the width of the circle as it goes down we get a cool spherical shading effect.</p>
<p>Below is an example of the shading you get with difference values for the divisor.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/08/planet-phases.png"><img src="/2013/08/16/3d-shading-with-points/images/planet-phases.webp" alt="planet phases" /></a></p>
<p>And that's pretty much all there is to it. A pretty simple effect that uses some cool math and a bit of random to pull off.</p>
<iframe height="300" style="width: 100%;" scrolling="no" title="Planets with points" src="https://codepen.io/loktar00/embed/zEhDB?height=300&theme-id=690&default-tab=js,result" frameborder="no" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href='https://codepen.io/loktar00/pen/zEhDB'>Planets with points</a> by Loktar
  (<a href='https://codepen.io/loktar00'>@loktar00</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Atari Rom Reader, and color picker]]></title>
            <link>https://somethinghitme.com/2013/06/20/atari-rom-reader-and-color-picker/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/06/20/atari-rom-reader-and-color-picker/</guid>
            <pubDate>Thu, 20 Jun 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[A small tool that reads Atari 7800 ROM data and renders graphics to canvas so I can browse sprites without taking screenshots. It covers 160A mode bit pairs, why the data reads "upside down", and a couple implementation notes.]]></description>
            <content:encoded><![CDATA[<p>Wanted to share an interesting yet simple project I created the other day. It simply dumps Atari 7800 roms and displays the data via canvas. I've wanted to create a few 7800 games for a long time, but playing the games and taking screenshots to remove sprites takes forever, so I made a simple application to do it for me (for the most part anyway).</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2013/06/asteroids.png"><img src="/2013/06/20/atari-rom-reader-and-color-picker/images/asteroids.webp" alt="7800 Asteroids Rip" /></a></p>
<p>This is the result of decoding the asteroids rom for the 7800.</p>
<p><a href="http://loktar00.github.io/AtariRomDisplay/">Atari Rom Display</a></p>
<p><a href="https://github.com/loktar00/AtariRomDisplay">Source</a> for anyone who is interested</p>
<p>It was actually pretty simple to do, first what I did was read up on the 7800 spec and different graphic modes it supports. I found that 160A was the mode used by most 7800 games. &nbsp;In 160a mode the sprites can have 3 colors , which are represented by a pair of bits.</p>
<p>00 = Background
01 = Color 1
11 = Color 2
10 = Color 3</p>
<p>So what I do is go through the entire rom and check the pair of bits and then draw that to the screen. Also since apparently it was faster, the graphics are stored upside down so I read the rom data in reverse order. I used AngularJS for the application as well just to get my feet with it, and created my own <a href="https://github.com/loktar00/PolyPicker">polyfill</a> for the color picker inputs, which I might post about later once its a bit more feature complete.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Creating a canvas platformer tutorial part two]]></title>
            <link>https://somethinghitme.com/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/</guid>
            <pubDate>Wed, 17 Apr 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[Part two of my canvas platformer series. I add world geometry, detect and resolve collisions by direction, and introduce grounded and jumping state so movement feels right.]]></description>
            <content:encoded><![CDATA[<p>Wow, so its been a while since I've posted anything. I've been kind of busy, and was forcing myself not to post anything unless it was going to be part two of the tutorial. With that said lets begin! For all the code and fully working demo scroll to the bottom.</p>
<p>Last we left off we had a pretty complete demo where we could run and jump around the screen. Now we are going to add some objects that the player can actually collide into!</p>
<p>Lets add an array called boxes to hold the objects well be doing collision checks against, and lets block the player from falling out of the screen by using our objects.</p>
<pre><code class="javascript language-javascript">var boxes = []

// dimensions
boxes.push({ x: 0, y: 0, width: 10, height: height });
boxes.push({ x: 0, y: height - 2, width: width, height: 50 });
boxes.push({ x: width - 10, y: 0, width: 50, height: height });
</code></pre>
<p>The above code sets up three boxes to enclose our game world. If you remember from the last tutorial we are checking coordinates directly to keep the player within the bounds, however since we are adding collisions we can just let our collision function handle that for us.</p>
<p>Lets got ahead and add some logic to draw the boxes so you can see them. Add the following code to your update function between clearRect and ctx.fillStyle = "red".</p>
<pre><code class="javascript language-javascript">ctx.fillStyle = "black"; ctx.beginPath();

for (var i = 0; i &lt; boxes.length; i++) {
    ctx.rect(boxes[i].x, boxes[i].y, boxes[i].width, boxes[i].height);
}

ctx.fill();
</code></pre>
<p>You should now see some thick black boxes on the left, right, and bottom of your canvas. Now lets actually make the player collide against them!</p>
<p>So Im going to give a pretty brief primer of the collision method we are using. We are going to be checking two objects against each other, the player, and a box. We will do this by checking if they intersect. If they intersect then they must be colliding. Since we are working on a platformer we need one more piece of information, from which direction is the player colliding? Go ahead and add the below function, it does just that!</p>
<pre><code class="javascript language-javascript">function colCheck(shapeA, shapeB) {
    // get the vectors to check against
    var vX = (shapeA.x + (shapeA.width / 2)) - (shapeB.x + (shapeB.width / 2)),
        vY = (shapeA.y + (shapeA.height / 2)) - (shapeB.y + (shapeB.height / 2)),
        // add the half widths and half heights of the objects
        hWidths = (shapeA.width / 2) + (shapeB.width / 2),
        hHeights = (shapeA.height / 2) + (shapeB.height / 2),
        colDir = null;

    // if the x and y vector are less than the half width or half height,
    // they we must be inside the object, causing a collision
    if (Math.abs(vX) &lt; hWidths &amp;&amp; Math.abs(vY) &lt; hHeights) {
        // figures out on which side we are colliding (top, bottom, left, or right)
        var oX = hWidths - Math.abs(vX), oY = hHeights - Math.abs(vY);
        if (oX &gt;= oY) {
            if (vY &gt; 0) {
                colDir = "t";
                shapeA.y += oY;
            } else {
                colDir = "b";
                shapeA.y -= oY;
            }
        } else {
            if (vX &gt; 0) {
                colDir = "l";
                shapeA.x += oX;
            } else {
                colDir = "r";
                shapeA.x -= oX;
            }
        }
    }
    return colDir;
}
</code></pre>
<p>The code is easy to figure out if you stare at it for a bit, but I'll go ahead and give a quick explanation of whats going on. First we need to calculate the current vector from the center of our objects, which is done in the very beginning.</p>
<p><img src="/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/images/fig1.webp" alt="" title="fig1" /></p>
<p>The player and box object at their current positions ready to be checked to see if they are colliding.</p>
<p>The above image shows the player and one of our boxes. We can tell they aren't currently colliding but lets step through to see how the function figures it out.</p>
<p><img src="/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/images/fig2.webp" alt="" title="fig2" /></p>
<p>Showing the vector calculation and half width, half height calculations.</p>
<p>Above shows the values we end up with for the vector, half widths, and half heights. The function checks the absolute values of the vector to see if they are less than the half width, and half height. If they are there is a collision. As you see from above our vector needed an x component of 25 or less, along with the y. Since they our values were both 35 (remember we check the absolute value meaning the -35 turns to 35) that means we are too far away and are currently not intersecting.</p>
<p>Now lets take a look at an example where the player and the box are intersecting.</p>
<p><img src="/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/images/fig3.webp" alt="" title="fig3" /></p>
<p>The player and the box are now intersecting since the vector components are less than the half width and half height.[/caption]</p>
<p>The above uses the same dimensions for the box and player, all we did was move the player closer to the box. The values for the x and y component of the vector come out to less than 25, meaning a collision has occurred. Now using this information we can actually get which side the collision occurred on. To do this we need to first figure out the offset vector, meaning how far are we into the other object. The below illustration shows how we do that.</p>
<p><img src="/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/images/fig4.webp" alt="" title="fig4" /></p>
<p>Calculating the offset vector after a collision has&nbsp;occurred.</p>
<p>So now we have the offsets, what do we need to do with them? First we check if the x components offset is greater than the y. If so that would tell us we either collided with the top or bottom of the object, because the assumption is the greater penetration is not actually *in* the object since we would have caught it much sooner. In our case the y offset is much greater meaning we collided with the left or right of the object and since our original vectors X is a positive number, it means it was on the left. If we were on the right side our x value would have came out positive due to the x coordinate of the player being greater than the x coordinate of the box.</p>
<p>Now we need to move the objects outside of each other, if we don't then they will just go further inside one another. This is very easy since we already have the offsets, and since we determined we collided on the left side, we move our box to the left by 2.</p>
<p>Alright so you have this collision function.. what the heck do you do with it? All you need to do is add the following inside the drawing loop for your boxes.</p>
<pre><code class="javascript language-javascript"> var dir = colCheck(player, boxes[i]);
</code></pre>
<p>Now we need to add a couple more things before we can actually do anything with the collisions. Add the property grounded, and sliding to your player object and set it false initially. Since we are going to have different things to jump off of we need to know if we are on solid ground or not, or if we should keep falling raising. Your player object should now look like this.</p>
<pre><code class="javascript language-javascript">player = {
   x: width / 2,
   y: height - 5,
   width: 5,
   height: 5,
   speed: 3,
   velX: 0,
   velY: 0,
   jumping: false,
   grounded: false
},
</code></pre>
<p>Lets go ahead and add the check to our jumping condition, change your jump key condition to the following.</p>
<pre><code class="javascript language-javascript">    if (keys[38] || keys[32]) {
        // up arrow or space
        if (!player.jumping &amp;&amp; player.grounded) {
            player.jumping = true;
            player.grounded = false;
            // We're not on the ground anymore!!
            player.velY = -player.speed * 2;
        }
    }
</code></pre>
<p>By looking at that you can see we can only jump if we are on the ground and are currently not jumping, and every time we jump set grounded to false. We also need to set grounded to false before we do the collision check every time so our player can fall off ledges, add the following right before the box loop.</p>
<pre><code class="javascript language-javascript">player.grounded = false;
</code></pre>
<p>Now lets go ahead and remove the following from your code, since we are going to be using our collision system instead of hard constraints when keeping the player in the canvas.</p>
<pre><code class="javascript language-javascript">    if (player.x &gt;= width - player.width) {
        player.x = width - player.width;
    } else if (player.x &lt;= 0) {
        player.x = 0;
    }

    if (player.y &gt;= height - player.height) {
        player.y = height - player.height;
        player.jumping = false;
    }
</code></pre>
<p>We just removed what told us our player isn't jumping anymore! We need to add some of that logic back in somewhere else! Add the following into your update function inside the box loop where you call the colCheck function.</p>
<pre><code class="javascript language-javascript">    if (dir === "l" || dir === "r") {
        player.velX = 0; player.jumping = false;
    } else if (dir === "b") {
        player.grounded = true;
        player.jumping = false;
    } else if (dir === "t") {
        player.velY *= -1;
    }
</code></pre>
<p>As you can see from that, if the collision direction is on the left or right we stop the player from moving left or right, if its on the bottom we set grounded to true since our feet have touched some sort of ground, and if its top, we just reverse the current force of our jump since we hit our head on the ceiling. You could just as easily make velY 0 but it feels a bit floaty to me.</p>
<p>The last thing you need to do is put the following code right after the box loop.</p>
<pre><code class="javascript language-javascript">if(player.grounded){
    player.velY = 0;
}

player.x += player.velX;
player.y += player.velY;
</code></pre>
<p>Delete the previous occurrence of player.x += player.velX, and player.y += player.velY. Go ahead and run it! If there are no errors the player should not fall through the world and should be able to run and jump around.. acting just like our previous demo!.. wait, so we did all that work just to make it like the last demo? Of course not, lets add some boxes right under the section where we declared our first set of boxes.</p>
<pre><code class="javascript language-javascript">    boxes.push({ x: 120, y: 10, width: 80, height: 80 });
    boxes.push({ x: 170, y: 50, width: 80, height: 80 });
    boxes.push({ x: 220, y: 100, width: 80, height: 80 });
    boxes.push({ x: 270, y: 150, width: 40, height: 40 });
</code></pre>
<p>Now go ahead run around and jump!</p>
<p>The entire program should look like the following</p>
<pre><code class="javascript language-javascript">(function () {
    var requestAnimationFrame = window.requestAnimationFrame ||
    window.mozRequestAnimationFrame ||
    window.webkitRequestAnimationFrame ||
    window.msRequestAnimationFrame;

    window.requestAnimationFrame = requestAnimationFrame;
})();

var canvas = document.getElementById("canvas"),
    ctx = canvas.getContext("2d"),
    width = 500,
    height = 200,
    player = {
        x: width / 2,
        y: height - 15,
        width: 5,
        height: 5,
        speed: 3,
        velX: 0,
        velY: 0,
        jumping: false,
        grounded: false
    },
    keys = [],
    friction = 0.8,
    gravity = 0.3;

var boxes = [];

// dimensions
boxes.push({ x: 0, y: 0, width: 10, height: height });
boxes.push({ x: 0, y: height - 2, width: width, height: 50 });
boxes.push({ x: width - 10, y: 0, width: 50, height: height });

boxes.push({ x: 120, y: 10, width: 80, height: 80 });
boxes.push({ x: 170, y: 50, width: 80, height: 80 });
boxes.push({ x: 220, y: 100, width: 80, height: 80 });
boxes.push({ x: 270, y: 150, width: 40, height: 40 });

canvas.width = width; canvas.height = height;

function update() {
    // check keys
    if (keys[38] || keys[32]) {
        // up arrow or space
        if (!player.jumping &amp;&amp; player.grounded) {
            player.jumping = true;
            player.grounded = false;
            player.velY = -player.speed * 2;
        }
    }

    if (keys[39]) {
        // right arrow
        if (player.velX &lt; player.speed) {
            player.velX++;
        }
    }

    if (keys[37]) {
        // left arrow
        if (player.velX &gt; -player.speed) {
            player.velX--;
        }
    }

    player.velX *= friction; player.velY += gravity;

    ctx.clearRect(0, 0, width, height);
    ctx.fillStyle = "black";
    ctx.beginPath();

    player.grounded = false;
    for (var i = 0; i &lt; boxes.length; i++) {
        ctx.rect(boxes[i].x, boxes[i].y, boxes[i].width, boxes[i].height);

        var dir = colCheck(player, boxes[i]);

        if (dir === "l" || dir === "r") {
            player.velX = 0;
            player.jumping = false;
        } else if (dir === "b") {
            player.grounded = true;
            player.jumping = false;
        } else if (dir === "t") {
            player.velY *= -1;
        }
    }

    if(player.grounded){
        player.velY = 0;
    }

    player.x += player.velX;
    player.y += player.velY;

    ctx.fill();
    ctx.fillStyle = "red";
    ctx.fillRect(player.x, player.y, player.width, player.height);

    requestAnimationFrame(update);
}

function colCheck(shapeA, shapeB) {
    // get the vectors to check against
    var vX = (shapeA.x + (shapeA.width / 2)) - (shapeB.x + (shapeB.width / 2)),
        vY = (shapeA.y + (shapeA.height / 2)) - (shapeB.y + (shapeB.height / 2)),
        // add the half widths and half heights of the objects
        hWidths = (shapeA.width / 2) + (shapeB.width / 2),
        hHeights = (shapeA.height / 2) + (shapeB.height / 2),
        colDir = null;

    // if the x and y vector are less than the half width or half height,
    // they we must be inside the object, causing a collision

    if (Math.abs(vX) &lt; hWidths &amp;&amp; Math.abs(vY) &lt; hHeights) {
        // figures out on which side we are colliding (top, bottom, left, or right)
        var oX = hWidths - Math.abs(vX),
            oY = hHeights - Math.abs(vY);

        if (oX &gt;= oY) {
            if (vY &gt; 0) {
                colDir = "t";
                shapeA.y += oY;
            } else {
                colDir = "b";
                shapeA.y -= oY;
            }
        } else {
            if (vX &gt; 0) {
                colDir = "l";
                shapeA.x += oX;
            } else {
                colDir = "r";
                shapeA.x -= oX;
            }
        }
    }
    return colDir;
}

document.body.addEventListener("keydown", function (e) { keys[e.keyCode] = true; });

document.body.addEventListener("keyup", function (e) { keys[e.keyCode] = false; });

window.addEventListener("load", function () {
    update();
});
</code></pre>
<p><a href="http://jsfiddle.net/loktar/da9cP/">Link to the code on jsfiddle</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Creating a canvas platformer tutorial part one]]></title>
            <link>https://somethinghitme.com/2013/01/09/creating-a-canvas-platformer-tutorial-part-one/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/01/09/creating-a-canvas-platformer-tutorial-part-one/</guid>
            <pubDate>Wed, 09 Jan 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[Part one of my canvas platformer series. I set up a player, build a requestAnimationFrame loop, track keyboard input, add friction and gravity, and implement a basic jump.]]></description>
            <content:encoded><![CDATA[<p>I've seen a few questions on <a href="https://stackoverflow.com" title="stackoverflow">Stackoverflow</a> lately dealing with how to smoothly move an object around on the canvas. This will be the first part, of my first ever attempted tutorial series. So please bear with me as I can sometimes be very confusing (to myself included) when trying to convey any topics dealing with development.</p>
<h2 id="whatwewillbemaking">What we will be making</h2>
<iframe height="386" style="width: 100%;" scrolling="no" title="Part 1 platformer tutorial" src="https://codepen.io/loktar00/embed/jHwBL?height=386&theme-id=690&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href='https://codepen.io/loktar00/pen/jHwBL'>Part 1 platformer tutorial</a> by Loktar
  (<a href='https://codepen.io/loktar00'>@loktar00</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<h2 id="whatdoineedtoknow">What do I need to know?</h2>
<p>What do you need to know before reviewing this tutorial? Not much really, a pretty basic understanding of&nbsp;JavaScript&nbsp;is required, and know what the <a href="https://developer.mozilla.org/en-US/docs/HTML/Canvas/Tutorial?redirectlocale=en-US&redirectslug=Canvas_tutorial">canvas</a> element is would be helpful.</p>
<h2 id="letsgetsetup">Lets get setup</h2>
<p>First lets start out by opening your favorite text editing program. My preferred tool is Sublime Text, but you can use anything, even notepad (although not recommended). Lets go ahead and create a file called game.html and setup the appropriate sections.</p>
<p>In your game.html put the following in.</p>
<pre><code class="html language-html">    &lt;!doctype html&gt;
    &lt;html&gt;
        &lt;head&gt;
            &lt;title&gt;My fancy game&lt;/title&gt;
        &lt;/head&gt;
        &lt;body&gt;
            &lt;script&gt;
                // All of our JavaScript will go here.
            &lt;/script&gt;
        &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
<h2 id="letsdrawsomething">Lets draw something!</h2>
<p>We are going to need a few things to start out with. We need a way to track the player object, we need a game loop to update logic and draw onto the screen, and we need to handle user input. So lets get started!</p>
<p>The first thing well do is create the canvas element we're going to use and get something drawn on it.</p>
<p>Use following markup to create the canvas element. Make sure to place it before the script tag in the html file we created.</p>
<pre><code class="html language-html">&lt;canvas id="canvas" style="border:1px solid #000"&gt;&lt;/canvas&gt;

&lt;script&gt;
    // All of our JavaScript will go here.
&lt;/script&gt;
</code></pre>
<p>I was also very bad and added an inline style to our canvas element. It allows us to see where its actually at on the page. As a caveat however this is a tutorial on creating a game with JavaScript and canvas, not a web standards tutorial.</p>
<p>Now add some JavaScript to get the player onto the screen. This will go between the script tags, right in the area that says</p>
<p><strong>//All of our JavaScript will go here</strong>.</p>
<pre><code class="js language-js">    var canvas = document.getElementById("canvas"),
        ctx = canvas.getContext("2d"),
        width = 500,
        height = 200,
        player = { x : width / 2, y : height - 5, width : 5, height : 5 };

    canvas.width = width; canvas.height = height;

    // draw a small red box, which will eventually become our player.
    ctx.fillStyle = "red";
    ctx.fillRect(player.x, player.y, player.width, player.height);
</code></pre>
<p>You can now test your file. To do that double click your html file, it should open up in your web browser by default. From now on everytime you want to test a change you can just refresh your page.</p>
<p>If you run what you have you should have something that looks like the following.</p>
<p><a href="https://www.somethinghitme.com/2013/01/09/creating-a-canvas-platformer-tutorial-part-one/tut1-1/"><img src="/2013/01/09/creating-a-canvas-platformer-tutorial-part-one/images/tut1-1.webp" alt="What you should have after the following code." /></a></p>
<p>AWW YEAH GOT SOMETHING ON SCREEN!</p>
<p>Ok maybe I'm too excited about that I don't know, regardless your dude is on the screen and I can tell he wants to get moving.</p>
<h2 id="thegameloopandrequestanimationframe">The game loop and requestAnimationFrame</h2>
<p>Now we need to add the game loop! If you're pretty new to canvas and making things move with canvas in particular you may of seen examples using setTimeout, or setInterval. DON'T USE THESE! They were great when&nbsp;that's&nbsp;all we had but for anything that requires constant rendering you want to use <a href="https://developer.mozilla.org/en-US/docs/DOM/window.requestAnimationFrame">requestAnimationFrame</a>. requestAnimationFrame is much better in a few ways, I wont go into all of them <a href="http://paulirish.com/2011/requestanimationframe-for-smart-animating/">but here is a good place to start reading why you should use it.</a> We will add a shim that was popularized by Paul Irish, which will use requestAnimationFrame on all browsers that support it, and fall back to good ol setTimeout on browsers that do not support it.</p>
<p>Add the following to the top of your js.</p>
<pre><code class="js language-js">    (function() {
        var requestAnimationFrame = window.requestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.msRequestAnimationFrame;
        window.requestAnimationFrame = requestAnimationFrame;
    })();
</code></pre>
<p>How are you supposed to use it? Its actually quite easy. Lets throw our rendering code into a function, well call it update since we will also place our update logic here as well. Note, this isn't a best practice but we are just doing it for the tutorials sake. Generally your rendering portion, and code that controls entities updating would be seperate so you could add things such as delta timing to control the rendering. However lets keep it simple!</p>
<p>Change the portion in your js that draws your player to the following.</p>
<pre><code class="js language-js">    function update(){
        // runs the loop each time
        requestAnimationFrame(update);
        // draw our player
        ctx.fillStyle = "red";
        ctx.fillRect(player.x, player.y, player.width, player.height);
    }
</code></pre>
<p>We also need a way to get our game loop kick started, so add a load event listener for the window to the end of your js file.</p>
<pre><code class="js language-js">    window.addEventListener("load", function(){ update(); });
</code></pre>
<p>Now run the code!!!! It still looks the same doesn't it? Alright lets add something to make it a bit more appealing.</p>
<h2 id="handlingnbspkeyboardinputfromtheuser">Handling&nbsp;keyboard input from the user</h2>
<p>So now we have our game loop, and our player object, all we need now is a way to get the player moving! We will do this by tracking key presses by the user, and moving our player accordingly.</p>
<p>First we need to add a few more properties to our player object, update your player object to the following.</p>
<pre><code class="js language-js">    player = { x : width/2, y : height - 5, width : 5, height : 5, speed: 3, velX: 0, velY: 0 }
</code></pre>
<p>As you can see we have added velocity variables for horizontal and vertical movement, and a speed variable. The velocities will be added to our current position, and the speed will control how fast we are able to go.</p>
<p>Next lets add an array named keys right after the player object.</p>
<pre><code class="js language-js">    keys = [];
</code></pre>
<p>So your variable declarations should now look like this.</p>
<pre><code class="js language-js">    var canvas = document.getElementById("canvas"),
        ctx = canvas.getContext("2d"),
        width = 500,
        height = 200,
        player = {
            x : width / 2,
            y : height - 5,
            width : 5,
            height : 5,
            speed: 3,
            velX: 0,
            velY: 0
        },
        keys = [];
</code></pre>
<p>Its time to add the keyboard events. If you have never dealt with the canvas element before, and keyboard events, you'll be disappointed to learn you can not tie keyboard events directly to the canvas element. So for the sake of this tutorial we will just bind them to the body.</p>
<p>Add the following.</p>
<pre><code class="js language-js">    document.body.addEventListener("keydown", function(e) {
        keys[e.keyCode] = true;
    });

    document.body.addEventListener("keyup", function(e) {
        keys[e.keyCode] = false;
    });
</code></pre>
<p>This is where the keys variable comes into play. Basically what this does is every time you touch, or hold a key down the element in the array at the same position as the keycode will be set to either true or false. Using this method it allows us to track multiple keys at one time rather than trying to handle key presses individually.</p>
<p>Alright onto adding the actual interaction! Add the following code to the top of the update function.</p>
<pre><code class="js language-js">    // check keys
    if (keys[38]) {
        // up arrow
    }

    if (keys[39]) {
        // right arrow
        if (player.velX &lt; player.speed) {
            player.velX++;
        }
    }

    if (keys[37]) {
        // left arrow
        if (player.velX &gt; -player.speed) {
            player.velX--;
        }
    }
</code></pre>
<p>The above code checks which keys are set to true, and if they are increases or decreases the players velocity. There's also a check that limits the speed of the player to the speed variable to make sure the player doesn't go too fast.</p>
<p>Its time to actually move the player, add the following code after the code you just added.</p>
<pre><code class="js language-js">    player.x += player.velX; player.y += player.velY;
</code></pre>
<p>Now if you go ahead and run your code, the player will actually move! But wait!! Don't run it yet, we need one more check in place. The next bit of code takes care of that, add it right after the player movement.</p>
<pre><code class="js language-js">    if (player.x &gt;= width-player.width) {
        player.x = width-player.width;
    } else if (player.x &lt;= 0) {
        player.x = 0;
    }
</code></pre>
<p>The above code will make your player stop and not go outside of the canvas. Now go ahead and run your code, your player should now run back and forth. Pretty badass amiright?! Ok maybe not that awesome. You probably are noticing the player keeps moving when you let up on the arrow key, whats up with that?</p>
<p>Instead of making the player just stop immediately, lets add some friction to our players movement. Go ahead and add a friction variable under the keys var, set it to 0.8, you can play with this to create more or less friction, a lower number makes you slide less, a higher number makes you slide more.</p>
<pre><code class="js language-js">    friction = 0.8;
</code></pre>
<p>Now add the following code in your game loop right after you check the keys.</p>
<pre><code class="js language-js">    player.velX *= friction;
</code></pre>
<p>Go ahead and run your code, your player should now stop when you let go, with a bit of a skid. Play with the value to increase or decrease how much your player slides around.</p>
<h2 id="timetogetjumping">Time to get jumping!</h2>
<p>What good is a platformer without jumping? Well.. I'm sure you could come up with some interesting games not using the jumping mechanic.. but that's besides the point!</p>
<p>You probably already know what we need to do to get our player to jump, we need to modify the players velocity on the y axis, every time we hit the desired key. &nbsp;Jumping can be tricky, there are a few gotchas when dealing with it.</p>
<p>First we need to add something to the player object to let us know if we are currently jumping or not.</p>
<pre><code class="js language-js">    player{
        // all the other properties previously entered...
        jumping : false
    }
</code></pre>
<p>Next we need to make the player jump when a key is pressed. This is pretty simple, we just add another check where we check for left and right arrow keys. We also need to set the players velocity to a negative value to make them into the air, and set the jumping property to true.</p>
<pre><code class="js language-js">    if (keys[38] || keys[32]) {
        // up arrow or space
        if (!player.jumping){
            player.jumping = true;
            player.velY = -player.speed * 2;
        }
    }
</code></pre>
<p>If you run the code now your player should jump, and fly away! So lets reign him in a little. We need to add gravity into the mix, or simulate it anyway. Lets add a gravity variable to our variable declarations at the top of the code. You can play with this value to make your player jump on the moon if you want! The lower the number the higher or "floatier" the jump.</p>
<pre><code class="js language-js">    gravity = 0.3;
</code></pre>
<p>Now to use gravity we need to add the following line within the update loop. Add it right after the line that applies friction to the horizontal movement we did earlier.</p>
<pre><code class="js language-js">    player.velY += gravity;
</code></pre>
<p>One more thing until we are "done", we need to make sure the player doesn't fall through the screen, and we need to reset the jump property when the player hits the ground. So lets add a boundary check right after we check the horizontal location of the player inside of the update function.</p>
<pre><code class="js language-js">    if (player.y &gt;= height-player.height) {
        player.y = height - player.height;
        player.jumping = false;
    }
</code></pre>
<p>Go ahead and run it! You should have a little dot that runs back and forth and jumps like a bauce!! Check out the full source below.</p>
<p><a href="https://codepen.io/loktar00/pen/jHwBL">Pen to mess around with</a></p>
<iframe height="386" style="width: 100%;" scrolling="no" title="Part 1 platformer tutorial" src="https://codepen.io/loktar00/embed/jHwBL?height=386&theme-id=690&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href='https://codepen.io/loktar00/pen/jHwBL'>Part 1 platformer tutorial</a> by Loktar
  (<a href='https://codepen.io/loktar00'>@loktar00</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
<h2 id="fullsource">Full source</h2>
<pre><code class="js language-js">    (function() {
        var requestAnimationFrame = window.requestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.msRequestAnimationFrame;

      window.requestAnimationFrame = requestAnimationFrame;
    })();

    var canvas = document.getElementById("canvas"),
      ctx = canvas.getContext("2d"),
      width = 500,
      height = 200,
      player = {
        x: width / 2,
        y: height - 5,
        width: 5,
        height: 5,
        speed: 3,
        velX: 0,
        velY: 0,
        jumping: false
      },
      keys = [],
      friction = 0.8,
      gravity = 0.2;

    canvas.width = width;
    canvas.height = height;

    function update() {
      // check keys
      if (keys[38] || keys[32]) {
        // up arrow or space
        if (!player.jumping) {
          player.jumping = true;
          player.velY = -player.speed * 2;
        }
      }

      if (keys[39]) { // right arrow
        if (player.velX &lt; player.speed) {
          player.velX++;
        }
      }
      if (keys[37]) {
        // left arrow
        if (player.velX &gt; -player.speed) {
          player.velX--;
        }
      }

      player.velX *= friction;

      player.velY += gravity;

      player.x += player.velX;
      player.y += player.velY;

      if (player.x &gt;= width - player.width) {
        player.x = width - player.width;
      } else if (player.x &lt;= 0) {
        player.x = 0;
      }
      if (player.y &gt;= height - player.height) {
        player.y = height - player.height;
        player.jumping = false;
      }

      ctx.clearRect(0, 0, width, height);
      ctx.fillStyle = "red";
      ctx.fillRect(player.x, player.y, player.width, player.height);

      requestAnimationFrame(update);
    }

    document.body.addEventListener("keydown", function(e) {
      keys[e.keyCode] = true;
    });

    document.body.addEventListener("keyup", function(e) {
      keys[e.keyCode] = false;
    });

    window.addEventListener("load", function() {
      update();
    });
</code></pre>
<p>Part two will focuses on colliding with objects, and actually building a little world for our player to interact with.</p>
<p><a href="https://somethinghitme.com/2013/04/16/creating-a-canvas-platformer-tutorial-part-tw/">Check out Part 2 for collisions!</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Rainbow bright bookmarklet]]></title>
            <link>https://somethinghitme.com/2013/01/03/rainbow-bright-bookmarklet/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2013/01/03/rainbow-bright-bookmarklet/</guid>
            <pubDate>Thu, 03 Jan 2013 00:00:00 GMT</pubDate>
            <description><![CDATA[A bookmarklet that cycles colors across every element on the page. Drag it to your bookmarks, click it on any site, and enjoy the chaos...]]></description>
            <content:encoded><![CDATA[<p>Went a little crazy with a friend of mines bookmarklet he made that would randomly change the colors of all elements on a page.</p>
<script src="http://gist.github.com/4445115.js"></script>
<p>Just drag this link to your bookmarks and click it on any random page to enjoy the show</p>
<p><a href="javascript:function c(){return Math.floor(255*Math.random())}function g(){var a=parseFloat(this.dataset.d);isNaN(a)&&(a=~~(100*Math.random()));with(this.style){var d=rgb((d{1,3}), (d{1,3}), (d{1,3}))/,b=d.exec(color),e={c:c(),b:c(),a:c()},f={c:c(),b:c(),a:c()};null!==b&&(e={c:b[1],b:b[2],a:b[3]});b=d.exec(backgroundColor);null!==b&&(f={c:b[1],b:b[2],a:b[3]});a+=0.5;100<a&&(a=0);cCycle=a+50;100<cCycle&&(cCycle-=100);h(e,cCycle);h(f,a);color='rgb('+e.c+','+e.b+','+e.a+')';backgroundColor='rgb('+f.c+','+f.b+','+f.a+')'}this.dataset.d=a}function j(){Array.prototype.forEach.call(document.all,function(a){setTimeout(function(){g.call(a)},10)});setTimeout(j,10)}function h(a,d){a.c=~~(127*Math.sin(0.3*d+0)+128);a.b=~~(127*Math.sin(0.3*d+2)+128);a.a=~~(127*Math.sin(0.3*d+4)+128)}j()">Bookmarklet</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Snowfall 1.6]]></title>
            <link>https://somethinghitme.com/2012/12/01/snowfall-1-6/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/12/01/snowfall-1-6/</guid>
            <pubDate>Sat, 08 Dec 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[Snowfall 1.6 adds image-based flakes and a pure JavaScript API alongside the jQuery version. This post shows how to start it, clear it, and the options you can tweak.]]></description>
            <content:encoded><![CDATA[<p><a href="https://github.com/loktar00/JQuery-Snowfall">Repo on Github</a> <a href="https://github.com/loktar00/JQuery-Snowfall/archive/master.zip">Download jQuery Snowfall 1.6</a> <a href="http://loktar00.github.com/JQuery-Snowfall/">View the plugin in action</a></p>
<p>You can now use images for snowflakes!</p>
<pre><code class="javascript language-javascript">// jQuery vs
$(document).snowfall({image :"image/flake.png", minSize: 10, maxSize:32});

// purejs vs
snowFall.snow(document.body, {image : "image/flake.png", minSize: 10, maxSize:32});
</code></pre>
<p><strong>Invoking the snow</strong></p>
<pre><code class="javascript language-javascript"> $(document).snowfall();
 $('#elementid').snowfall({flakeCount : 100, maxSpeed : 10});
 $('.class').snowfall({flakeCount : 100, maxSpeed : 10});
</code></pre>
<p><strong>Snowfall Methods</strong></p>
<pre><code class="javascript language-javascript"> // stopping the snow
 $(document).snowfall('clear');
 $('#elementid').snowfall('clear');
 $('.class').snowfall('clear');
</code></pre>
<p><strong>Options currently supported with default values</strong></p>
<pre><code class="javascript language-javascript"> options = {
    flakeCount : 35, // number
    flakeColor : '#ffffff', // string
    flakeIndex: 999999, // number
    minSize : 1, // number
    maxSize : 3, // number
    minSpeed : 2, // number
    maxSpeed : 3, // number
    round : false, // bool
    shadow : false, // bool
    collection : 'element' // string
};
</code></pre>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Retroships.com]]></title>
            <link>https://somethinghitme.com/2012/10/01/retroships-com/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/10/01/retroships-com/</guid>
            <pubDate>Mon, 01 Oct 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[A weekend project where I generate 2D retro ships with node-canvas and serve them from Nodejitsu. I also cover a few ideas I wanted next, like seeds, ship styles, and a simple generate URL.]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/10/retroship.png"><img src="/2012/10/01/retroships-com/images/retroship.webp" alt="retroship" /></a></p>
<p>I decided to create a small project this weekend, using node, and <a href="http://nodejitsu.com">nodejitsu.com</a>. The concept was really simple, to generate a 2d ship that could be used in games, or any programs really. The project turned out pretty well check out&nbsp;<a href="http://retroships.com/">http://retroships.com/</a>. The ships are generated via node-canvas, and displayed to the user. The stars are done with standard client side canvas. I'm sure I'll be creating a few more micro sites like this, and possibly a full on app for procedural graphic generation at some point.</p>
<p>As for retroships.com features there's a few more things I need to add such as the ability to pick different ship styles, an option for seeds, and the ability to get only the ship graphics from a simple url such as retroships.com/generate?type=2&amp;seed=blah.</p>
<p>As for using nodejitsu, its great, setup was *really* simple. I'm looking forward to the paid tiers so I don't have to worry about my site just suddenly ceasing to function. The only issue I had was with deploys. I had to deploy 2-3 times due to errors with node-canvas.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Super Simple Wave Simulators]]></title>
            <link>https://somethinghitme.com/2012/09/10/super-simple-wave-simulators/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/09/10/super-simple-wave-simulators/</guid>
            <pubDate>Mon, 10 Sep 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[Two wave sims I put together after going down a water-effects rabbit hole: one in JavaScript + canvas, and one that does it with just HTML/CSS. Both have embedded demos (and CodePen links) and were picked / featured on codepen.]]></description>
            <content:encoded><![CDATA[<p>So I have been really into wave sims lately. It all started with an excellent tutorial posted <a href="http://gamedev.tutsplus.com/tutorials/implementation/make-a-splash-with-2d-water-effects/">here</a>. I tried my hand at a JS one first using canvas which turned out pretty awesome.</p>
<iframe style="width: 100%; height: 300px;" src="https://jsfiddle.net/loktar/bafTq/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p><a href="http://codepen.io/loktar00/details/DlFgw">Check it out on codepen as well</a>.</p>
<p>Then I tried something else a bit crazy and decided to do the same thing with only html/css. It turned out pretty cool, not as interactive as the JS one but the effect is still nice. I could see this being used on the bottom of a website.</p>
<iframe style="width: 100%; height: 300px;" src="https://jsfiddle.net/loktar/M9Brh/embedded/result,js,html,css/" height="240" width="320" frameborder="0"></iframe>
<p><a href="http://codepen.io/loktar00/details/kfrKC">Also a link on codepen.</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[My sons first game Dark Slayer]]></title>
            <link>https://somethinghitme.com/2012/06/21/my-sons-new-game/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/06/21/my-sons-new-game/</guid>
            <pubDate>Fri, 22 Jun 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[My sons Jacob and Gavin build their first canvas game, Dark Slayer, after following a Lost Decade Games tutorial. They added enemies that shoot, player health, and an ending, and created the art.]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/projects/darkslayer/"><img src="/2012/06/21/my-sons-new-game/images/darkslayer-300x257.webp" alt="" title="darkslayer" /></a>My son Jacob decided to learn how to program. He followed the <a href="http://www.lostdecadegames.com/how-to-make-a-simple-html5-canvas-game/">great tutorial from Lost Decade Games</a>, and added his own flare to it. He added enemies that shoot, player health, and the game can also end. So proud of him for making it. I helped with a few small things, but the majority was done by him. His brother Gavin also helped with art along with their sister Gabi.</p>
<p>Check out&nbsp;<a href="http://www.somethinghitme.com/projects/darkslayer/">Dark Slayer</a></p>
<p><img src="/2012/06/21/my-sons-new-game/images/11Y88.webp" alt="" title="Boys working hard on game" /></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[2d Metaballs with canvas!]]></title>
            <link>https://somethinghitme.com/2012/06/06/2d-metaballs-with-canvas/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/06/06/2d-metaballs-with-canvas/</guid>
            <pubDate>Thu, 07 Jun 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I recreated the metaballs effect in JavaScript canvas using radial gradients and an alpha threshold. This post walks through the approach, includes the gists, and links a demo and JSFiddle to play with.]]></description>
            <content:encoded><![CDATA[<p>I read this <a href="http://nullcandy.com/2d-metaballs-in-xna/">great article</a>&nbsp;on creating 2d metaballs with XNA. I never really looked into the concept behind them, but after reading that they seemed pretty simple. I decided to try my hand at it using javascript and canvas. The results were pretty awesome (well in my opinion anyway).</p>
<p><strong>Quick attempt at explaining my understanding at metaballs without butchering them</strong></p>
<p>The basic concept is to use a radial gradient, and set an alpha threshold that will be filtered. For example any pixel with an alpha lower than 150 will be set to an alpha of 0. This gives the metaball effect because when the gradients overlap, the areas that are normally hidden now have their alpha values added which brings them above the threshold.</p>
<p><strong>One way to achieve this using canvas and javascript</strong></p>
<p>So basically what I do is create a bunch of points, and set their velocities, positions and sizes.</p>
<script src="http://gist.github.com/2885768.js"></script>
<p>Next I draw each of these onto a temp canvas</p>
<script src="http://gist.github.com/2885774.js"></script>
<p>Then finally I read the pixel data, filter the alpha based on a threshold I set, and put the filtered data back onto the main canvas to be displayed.</p>
<script src="http://gist.github.com/2885780.js"></script>
<p><a href="http://somethinghitme.com/projects/metaballs/">Check out the demo with added features</a> or the <a href="http://jsfiddle.net/loktar/TscNZ/">jsfiddle</a> to play around with.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Turning canvas games into executables]]></title>
            <link>https://somethinghitme.com/2012/03/29/turning-canvas-games-into-executables/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/03/29/turning-canvas-games-into-executables/</guid>
            <pubDate>Thu, 29 Mar 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I wrapped an HTML5 canvas game into a self-contained executable using Qt WebKit and embedded resources so the assets are not exposed. This is the quick write-up of the approach and what I wanted to test next (dependencies and performance).]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/03/ss1333030211.3125.png"><img src="/2012/03/29/turning-canvas-games-into-executables/images/ss1333030211.3125-288x300.webp" alt="" title="tetris exe" /></a></p>
<p>This is something I've been looking to do for the longest time. The closest I ever got was using Adobe Air. I didn't like that solution though because it left all of your&nbsp;assets&nbsp;out in the open. Recently a friend reminded me about&nbsp;<a href="http://qt.nokia.com/products/">QT</a>&nbsp;something I haven't touched in a few years. After looking over some of their webkit examples I realized I could load in embedded resources.. making self contained canvas games.</p>
<p>I tested out my theory using the Fancy Browser sample, and just modifying it to load an embedded html, which include all the code for the game.</p>
<p>So far it works great. I need to do some more tests, such as finding out what&nbsp;dependencies&nbsp;the executable requires, and also what kind of performance I get (QT5 will include V8). This is still pretty cool in my opinion, just another way to monetize HTML5 games :)…. or even… HTML5&nbsp;screen savers!</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JEST another HTML5 Game Framework]]></title>
            <link>https://somethinghitme.com/2012/03/18/jest-another-html-game-framework/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/03/18/jest-another-html-game-framework/</guid>
            <pubDate>Mon, 19 Mar 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I cleaned up my home-grown canvas game framework and posted it on GitHub as JEST. It is a compact base I use for demos and small games, and the post links the repo plus an early demo.]]></description>
            <content:encoded><![CDATA[<p>I've been coming up with small games and demos using canvas for a couple of years now, and over that time I've created a framework for doing so. You can see examples in some of my earlier blog posts such as the SOPA game, and the SHMUP thats been in development for a while. Today I decided to pretty some of it up a bit and post it on github. Minified it comes in at only 31k, and provides quite a bit of functionality (I am biased though).</p>
<p><a href="https://github.com/loktar00/jest">Here is a link to the github repo</a>&nbsp;and the <a href="http://loktar00.github.com/jest/">first of many demo's I'll be posting</a>.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[HTML5 Canvas Flood Fill]]></title>
            <link>https://somethinghitme.com/2012/03/07/html5-canvas-flood-fill/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/03/07/html5-canvas-flood-fill/</guid>
            <pubDate>Wed, 07 Mar 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I implemented a recursive flood fill for a Rampart-ish canvas prototype and broke down how it works. Includes the core function, how I call it on a 2D array, and a JSFiddle to try it (plus a quick note on stack limits for large maps).]]></description>
            <content:encoded><![CDATA[<p>Messing around in JS today (surprising eh?) making an HTML5 vs of rampart-ish. The more I do the less it becomes like rampart. Today I decided to tackle the flood fill portion which is a major part of the gameplay.</p>
<p>Here is the workhorse function</p>
<pre><code class="javascript language-javascript">function floodFill(mapData, x, y, oldVal, newVal){
    var mapWidth = mapData.length, mapHeight = mapData[0].length;

    if (oldVal == null){
        oldVal=mapData[x][y];
    }

    if (mapData[x][y] !== oldVal){
        return true;
    }

    mapData[x][y] = newVal;

    if (x &gt; 0){
        floodFill(mapData, x-1, y, oldVal, newVal);
    }

    if (y &gt; 0){
        floodFill(mapData, x, y-1, oldVal, newVal);
    }

    if (x &lt; mapWidth-1){
        floodFill(mapData, x+1, y, oldVal, newVal);
    }

    if (y &lt; mapHeight-1){
        floodFill(mapData, x, y+1, oldVal, newVal);
    }
}
</code></pre>
<p>Which is called by doing this</p>
<pre><code class="javascript language-javascript">    floodFill(map, 3,3,null,2);
</code></pre>
<p>map refers to a 2 dimensional array which contains the data, in my case, 0 or 1. The second 2 parameters are the x and y of where to start on the map, null is the initial value to start with, and 2 is the change value parameter, which tells the function to change any tile with the value 0, to 2.</p>
<p>The function is pretty straightforward it recursively checks each points north/south/east/west neighbor until it encounters a neighbors whos value is not 0. <a href="http://jsfiddle.net/loktar/ZLw9m/">Try the code for yourself</a>. I have portions commented out that generate a larger random map to fill for testing purposes. Anything beyond 256x256 has issues within chrome due to stack size restrictions.</p>
<p>Below is the result of the function.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/03/filled.png"><img src="/2012/03/07/html5-canvas-flood-fill/images/filled-300x300.webp" alt="" title="Flood Fill" /></a></p>
<p><a href="http://inventwithpython.com/blog/2011/08/11/recursion-explained-with-the-flood-fill-algorithm-and-zombies-and-cats/">And here is a link to some great information on recursive floodfilling</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[HTML5 Canvas Particle engine]]></title>
            <link>https://somethinghitme.com/2012/02/23/html5-canvas-particle-engine/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/02/23/html5-canvas-particle-engine/</guid>
            <pubDate>Fri, 24 Feb 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[Progress on a basic canvas particle engine tied into my game framework. I share a screenshot, a demo link, and my plan to build a small editor so I can tune effects visually.]]></description>
            <content:encoded><![CDATA[<p>In my attempt to make a post weekly figured I would post some progress on my current project, which is a side project for the shmup I'm working on.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/02/particles.png"><img src="/2012/02/23/html5-canvas-particle-engine/images/particles-300x265.webp" alt="" title="particles" /></a></p>
<p>Just a basic particle engine using canvas (of course). Its tied in directly with my home grown game framework, so implementing it into my projects should be a breeze. Going to attempt to make an editor for it over the weekend.. heh mostly for me to just mess around, but of course it has the other benefit of allowing me to make effects visually, which is easier. <a href="http://www.somethinghitme.com/projects/particle%20test/">Check it out</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Procedural Canvas Shmup now has a boss and sounds!]]></title>
            <link>https://somethinghitme.com/2012/02/13/procedural-canvas-shmup-now-has-a-boss-and-sounds/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/02/13/procedural-canvas-shmup-now-has-a-boss-and-sounds/</guid>
            <pubDate>Tue, 14 Feb 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[A quick progress update on my procedural canvas shmup: adding music and sound made a huge difference, and I finally dropped in a boss. I also list what I wanted next, like player upgrades and more consistent seeded visuals.]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/02/shmupboss.png"><img src="/2012/02/13/procedural-canvas-shmup-now-has-a-boss-and-sounds/images/shmupboss-250x300.webp" alt="" title="shmupboss" /></a></p>
<p>Its crazy how much of a difference music and sounds make. Been working on my shmup when not busy and got a boss in today. So much work still left to be done though, I want upgrades for the player ship still, and possibly a more consistent look for the enemies depending on the seed (like a shared color scheme).</p>
<p><a href="http://www.somethinghitme.com/pprojects/shump/">You can check out my progress here</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Glow Roids]]></title>
            <link>https://somethinghitme.com/2012/02/07/glow-roids/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/02/07/glow-roids/</guid>
            <pubDate>Tue, 07 Feb 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I am archiving Glow Roids, one of my first C# + OpenGL projects using Tao. It includes screenshots and a download, with a note that it can be finicky on different machines.]]></description>
            <content:encoded><![CDATA[<p>Posting this for archival purposes. Its a game I made a few years back, was really my first foray into C# and OpenGL. I used Tao which to my knowledge isn't updated or used anymore. With that being said the game can be a bit finicky on different machines.</p>
<p><a href="http://www.blitzbasic.com/Community/posts.php?topic=76998">Original Post</a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/02/as2.jpg"><img src="/2012/02/07/glow-roids/images/as2-300x213.webp" alt="" title="as2" /></a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/02/as1.jpg"><img src="/2012/02/07/glow-roids/images/as1-300x214.webp" alt="" title="as1" /></a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/02/as3.jpg"><img src="/2012/02/07/glow-roids/images/as3-300x214.webp" alt="" title="as3" /></a></p>
<p><a href="http://www.somethinghitme.com/projects/glowroids.zip">Download</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Current Project Canvas Shmup]]></title>
            <link>https://somethinghitme.com/2012/01/25/current-project-canvas-shmup/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/01/25/current-project-canvas-shmup/</guid>
            <pubDate>Thu, 26 Jan 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I am working on a canvas shoot 'em up where the graphics and the level are generated from a seed. Use the same seed as someone else and you get the same run, with a link to the WIP build.]]></description>
            <content:encoded><![CDATA[<p>Posting my most current project (well my most current that happens to be cool anyway). Its a canvas shootemup, not really sure what I'll settle on for a title, but heres a screeny</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/01/shmup.png"><img src="/2012/01/25/current-project-canvas-shmup/images/shmup.webp" alt="" title="shmup" /></a></p>
<p>What I think is pretty cool about it so far is all the graphics (except the bg) are procedural and generated based off of whatever seed you give it. Not only are the graphics based on a seed but so is the level. For example if you play game?testing, you will have the same level/graphics as someone else who plays using that seed. This could provide some interesting challenges. Anyway <a href="http://www.somethinghitme.com/pprojects/shump/?shmupity">heres the work in progress</a>&nbsp;using the seed shmupity.</p>
<p>Also of course this is being done using js/canvas so you need a modern browser to test it.. but I&nbsp;don't&nbsp;think&nbsp;there's&nbsp;many&nbsp;who'd&nbsp;come here without one of those :).</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[My SOPA/PIPA Ludum Dare entry]]></title>
            <link>https://somethinghitme.com/2012/01/18/my-sopapipa-ludum-dare-entry/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/01/18/my-sopapipa-ludum-dare-entry/</guid>
            <pubDate>Thu, 19 Jan 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[I made a one-day Ludum Dare jam game in JS and canvas, heavily inspired by World Infectonator. You get one chance to convert someone and hope the chain reaction carries the level, with a direct link to play it.]]></description>
            <content:encoded><![CDATA[<p><img src="/2012/01/18/my-sopapipa-ludum-dare-entry/images/screen1.webp" alt="" title="screen1" /></p>
<p>Was pretty stressful trying to make this in a day (especially since I did a full workday at my day job as well!).</p>
<p><a href="http://www.ludumdare.com/compo/sopajam/?action=preview&uid=10305">This ended up being my entry</a>.</p>
<p>I borrowed some game concepts (ok all of them) from the awesome game World Infectonator. Basically what you do is you get one chance to convert a 1%'er or "the unaware" in hopes they will spread their new found awareness enough to beat the level. Game was done using JS and Canvas of course, and using my homegrown game engine thats been evolving over the last year or so. You can check out the game in all its glory</p>
<p><a href="http://www.somethinghitme.com/projects/sopa/">from the direct link</a>.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Installing Alpha Centauri Alien Crossfire on Windows 7]]></title>
            <link>https://somethinghitme.com/2012/01/01/alpha-centauri-alien-crossfire-on-windows-7/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2012/01/01/alpha-centauri-alien-crossfire-on-windows-7/</guid>
            <pubDate>Sun, 01 Jan 2012 00:00:00 GMT</pubDate>
            <description><![CDATA[How to install and run Alpha Centauri on Windows 7 from the original CD]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/01/images.jpg"><img src="/2012/01/01/alpha-centauri-alien-crossfire-on-windows-7/images/images.webp" alt="" title="Alpha Centauri Alien Crossfire" /></a>This is kind of a random post, but its something I ran into this week on vacation after getting a copy of Soldout Softwares Alpha Centauri with the Alien Crossfire expansion pack. If you're like me and tried installing the game from the cd, the setup.exe just hangs. But never fear there is a way to get it working!</p>
<p><strong>Step 1</strong> - Make a directory somewhere on your machine, but not in program files, or program files(x86). Otherwise in order to save you will have to run the game as an administrator. What I did was create a directory structure on the root of my drive "DRIVE:\Firaxis\Sid Meier's Alpha Centauri\".</p>
<p><strong>Step 2</strong> - Copy the contents of the "programs" directory from Disc 1 to the directory we created above. Now copy the Directories FX, MOVIES, and VOICES into the directory. Now your structure should look something like the following,</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2012/01/dir1.png"><img src="/2012/01/01/alpha-centauri-alien-crossfire-on-windows-7/images/dir1.webp" alt="" title="dir" /></a></p>
<p>Now do the same with CD2, copy the contents of programs to the root of the same directory and then copy FX/MOVIES/VOICES, and just acknowledge the file overwrites. At this point you now have a "working" copy of the game, you just run Terran.exe, or Terranx.exe in order to play, but you will probably have a few odd issues with windows not appearing, and low resolution. So I recommend you follow the rest of the directions posted at <a href="http://forums.2kgames.com/showthread.php?112816-SMAC-on-Win-7-64-bit">this forum</a> (2nd post).</p>
<p>In case the above forum post is deleted or something I wanted to have the info here as well, but I encourage trying the link above first.</p>
<blockquote>
  <p>I run Alpha Centauri and it's expansion Alien Crossfire on Windows 7 64-bit with no problems. However the following are a few of the things I've had to do to make them work the best they can:</p>
  <p>Once you apply the Windows XP Compatibility patch then you are almost good to go for Windows 7 64-bit. If you are getting an error message then try to re-download that patch or run the patch itself in a compatibility mode perhaps with the "run as administrator" option.</p>
  <p>You are&nbsp;<em>almost</em>&nbsp;ready to go. Before you even install&nbsp;<strong>any</strong>&nbsp;patches first make sure the installation folder is not within either the "Program Files" or "Program Files (x86)" folders. This is because Alpha Centauri (and Alien Crossfire) put their save games within their folders. Starting with Vista and newer this will not work because of User Access Control. So, choose an installation folder outside of "Program Files.."</p>
  <p>Alpha Centauri's native resolution is 800x600. You can change this however: in the installation folder, find a file named "Alpha Centauri.ini" and open it with NotePad. In that file, Under "[Alpha Centauri]" add two lines:</p>
  <p>Video Mode=1024 DirectDraw=0</p>
  <p>The first line will tell the game to run at 1024x768 which is the maximum resolution using DirectDraw that the game can run with. The second line tells the game to not use DirectDraw and it will instead run at your desktop resolution.</p>
  <p>Not done yet!&nbsp;<img src="images/wink.gif" alt="" title="Wink" />&nbsp;Alpha Centauri itself (not Alien Crossfire) has a bug when running at your desktop resolution. In the main menu the menu's are not visible. This makes getting into a game practically blind luck. There is a fix however:</p>
  <p>If you have Alien Crossfire, get this patch:&nbsp;<a href="http://www.civgaming.net/forums/showthread.php?t=7511">Here</a>. Also get this patch:&nbsp;<a href="http://www.rpgcodex.net/phpBB/viewtopic.php?t=56203">Here</a>. Rename terran.exe and terranx.exe (if you have Alien Crossfire) so you have backup's of them. Then unarchive the first patch into your SMAC folder then unarchive the second into it as well overwriting any files (but keep backups of any overwritten files). You can skip the first archive if you don't have Alien Crossfire. Either of these patches will fix the menu not being visible when using the DirectDraw=0 option. So, you'll be at your desktop resolution and everything will work with these unofficial patches. Both unofficial patches also come with something extra: AI improvements! That is just bonus on top of getting them to work at desktop-resolution!</p>
  <p>Almost done! Go back to the "Alpha Centauri.ini" file. Under that put in:</p>
  <p>ForceOldVoxelAlgorithm=0</p>
  <p>This line if it doesn't already exist. With the unofficial patches you can use "=0" but if you don't use those patches then you will need to set it to "=1" or they will crash.</p>
  <p>All of these instructions assume you can get Alpha Centauri to it's last patch: the Windows XP/2000 patch. If you can do that then these instructions just "fix it up" to be the best it can be on a modern system.</p>
  <p>If anything is unclear or I can help further just post back. Post back regardless whether you get it working or not!</p>
  <p>Also, Alpha Centauri itself is now available on Good Old Games.com here:&nbsp;<a href="http://www.gog.com/en/gamecard/sid_meiers_alpha_centauri">Link</a>. I don't know how well the unofficial patches will work with that version but that version is "turn-key": it's super simple to install and get going!</p>
</blockquote>
<p>And enjoy :)</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Fake 2d Lighting with javascript]]></title>
            <link>https://somethinghitme.com/2011/11/16/fake-2d-lighting-with-javascript/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/11/16/fake-2d-lighting-with-javascript/</guid>
            <pubDate>Wed, 16 Nov 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[Messing around with realtime 2D raycasting to fake lighting in canvas. This post links my JS version and a fiddle, plus notes on tracking the closest hit per ray and ideas like using the same approach for an AI vision cone.]]></description>
            <content:encoded><![CDATA[<p>Just started messing with realtime 2d raycasting for lighting today, used a pretty good code example from <a href="http://www.facepunch.com/threads/1011659">facepunch.com/threads/1011659</a>. <a href="http://www.somethinghitme.com/projects/2d%20lighting/fakelight.html">Heres my version in JS</a>, and <a href="http://jsfiddle.net/loktar/VY75L/16/">a fiddle to play with</a>. If you look at the code you'll notice I added a portion to keep track of the closest block per ray so you can light up only that block and not the others. However doing this got me to thinking, this method can be used to make a vision cone for AI. Ive seen this raycasting method used before I just never implemented it myself.. besides my *really* slow implementation for lighting on my <a href="http://www.somethinghitme.com/projects/canvasterrain/">canvas terrian.</a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2011/11/2dlighting.png"><img src="/2011/11/16/fake-2d-lighting-with-javascript/images/2dlighting.webp" alt="" title="2dlighting" /></a></p>
<p>I might mess with this some more, got a few ideas for a small game or two, but who knows if I'll actually get around to it before finding something else that's shiny. Feel free to do whatever with the code. There's a lot of room for optimization.</p>
<p>Figured I might as well post this thing I was messing around with. <a href="http://jsfiddle.net/loktar/PyW5d/19/">Same concept but much slower</a> .</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2011/11/pyramid.png"><img src="/2011/11/16/fake-2d-lighting-with-javascript/images/pyramid.webp" alt="" title="pyramid" /></a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Meat Boy Pumpkin!]]></title>
            <link>https://somethinghitme.com/2011/10/30/meat-boy-pumpkin/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/10/30/meat-boy-pumpkin/</guid>
            <pubDate>Mon, 31 Oct 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[I tried grinding a pumpkin instead of carving and went with a Super Meat Boy face. First attempt, but it was a fun experiment. ]]></description>
            <content:encoded><![CDATA[<p><img src="/2011/10/30/meat-boy-pumpkin/images/389284_10150368898699442_370952285_n.webp" alt="" title="pumpkin" /></p>
<p>Decided to give grinding a pumpkin a shot instead of the usual carving, and this was my inaugural attempt. Super Meat Boy is my jam, so I just had to try and capture his little face! Clearly, I've got some honing to do, so maybe I'll be practicing on apples or something for the rest of the year.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Another Android live wallpaper, Forest Scene]]></title>
            <link>https://somethinghitme.com/2011/10/30/another-android-live-wallpaper-forest-scene/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/10/30/another-android-live-wallpaper-forest-scene/</guid>
            <pubDate>Sun, 30 Oct 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[I created an Android live wallpaper forest scene inspired by a JS1K demo submission.]]></description>
            <content:encoded><![CDATA[<p><img src="/2011/10/30/another-android-live-wallpaper-forest-scene/images/screen1.webp" alt="" title="Forest Scene" /></p>
<p>The idea is *heavily* inspired by a <a href="http://js1k.com/2011-dysentery/demo/994" title="Forest Scene">JS1K demo submission</a> that was done by @daisyowl.</p>
<p>&nbsp;I just thought the demo was so cool it was begging to be a live wallpaper. I plan on adding more features such as clouds/different seasons etc. Heres a link to the source if anyones interested,&nbsp;<a href="https://github.com/loktar00/Android-Forest-LWP">https://github.com/loktar00/Android-Forest-LWP</a>&nbsp;and heres the link to it on the app market,&nbsp;<a href="https://market.android.com/details?id=com.loktar.forestscenes&feature=search_result">https://market.android.com/details?id=com.loktar.forestscenes&feature=search_result</a></p>
<p><a href="https://loktar00.github.io/demos-and-deviations/demos/animated%20tree%20scene/">And here's my recreation in JS</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Gaming Gaming Gaming]]></title>
            <link>https://somethinghitme.com/2011/10/30/gaming-gaming-gaming/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/10/30/gaming-gaming-gaming/</guid>
            <pubDate>Sun, 30 Oct 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[Random thoughts on my gaming collection]]></description>
            <content:encoded><![CDATA[<p>So I realized I have never posted anything on here about my gaming habits. Gaming is a huge part of my life its probably a bit higher than programming even. I am VERY partial to PC gaming, consoles are ok.. but I just look at them as underpowered PC's :P. Plus its nice being able to install my copy of Homeworld and play it 13 years later without issue. Anyway I figure I will start to post some of my thoughts on games I am currently playing, and maybe some other tidbits from my collection.</p>
<p><strong>My collection</strong></p>
<p>I'll have to get some pictures up.. but I love collecting PC games, old and new. Currently my Steam account sits at just under 800 games, and my physical copy count sits at about 600 or so. I have most popular games that were released for the PC and quite a few obscure ones. I wont lie I haven't played them all, last time I calculated I have played about a third of them. Once I get my spreadsheet up to date I'll post it on here.</p>
<p><strong>Games I'm currently playing</strong></p>
<p>Right now I'm switching between a few games, Dungeon Defenders, Battlefield 3, and Team Fortress 2. The Halloween events in TF2, and Dungeon Defenders are great I love when games include things going on in the real world, such as holidays.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Android Live Wallpaper Guts and Goo]]></title>
            <link>https://somethinghitme.com/2011/10/11/android-live-wallpaper-guts-and-goo/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/10/11/android-live-wallpaper-guts-and-goo/</guid>
            <pubDate>Tue, 11 Oct 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[Explore the creation process of an Android live wallpaper called Guts and Goo. Learn about the technologies used, including libgdx and the libgdx live wallpaper backend. Discover the challenges faced, such as handling Android preferences, and look forward to future updates and the release of a lite version with additional features.]]></description>
            <content:encoded><![CDATA[<p>Just released <a href="https://market.android.com/details?id=com.loktar.particleswirl&feature=search_result">my second live wallpaper, Guts and Goo</a></p>
<p><img src="/2011/10/11/android-live-wallpaper-guts-and-goo/images/screen-0.webp" alt="Guts and Goo" title="Guts and Goo" /></p>
<p><img src="/2011/10/11/android-live-wallpaper-guts-and-goo/images/screen-2.webp" alt="Guts and Goo" title="Guts and Goo" /></p>
<p>Used <a href="http://www.badlogicgames.com/wordpress/">libgdx</a> along with the <a href="http://code.google.com/p/libgdx-backend-android-livewallpaper/">libgdx live wallpaper backend</a>. Was a fun project, found out about an awesome filter library while making it, its what allowed for such great high res nasty images.</p>
<p>The hardest thing besides a bit of OpenGL I had to learn was the Android preferences. I don't know why but I have such a hard time getting them working right. So right now the only option is to pick different images to mess with. I plan on adding more later. I also plan on releasing a "lite" version which only includes one background to choose.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[jQuery Snowfall 1.5 update now with snow buildup!]]></title>
            <link>https://somethinghitme.com/2011/10/05/jquery-snowfall-1-5-update-now-with-snow-buildup/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/10/05/jquery-snowfall-1-5-update-now-with-snow-buildup/</guid>
            <pubDate>Thu, 06 Oct 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[I updated the Snowfall plugin to add snow buildup, so flakes can collect on top of elements you target with a selector. This post shows the new collection option, standard usage, the clear method, and the full option list.]]></description>
            <content:encoded><![CDATA[<p><strong><a href="http://www.somethinghitme.com/2012/12/08/snowfall-1-6/">Check out the new version here, with the ability to add images to snowflakes!</a></strong></p>
<p><a href="https://github.com/loktar00/JQuery-Snowfall">Repo on Github</a> <a href="https://github.com/loktar00/JQuery-Snowfall/archive/master.zip">Download jQuery Snowfall 1.5</a> <a href="http://loktar00.github.com/JQuery-Snowfall/">View the plugin in action</a></p>
<p>Added snow buildup to the plugin, so now you can pass a jquery selector in the collection option and the snow will collect on top of all the elements matched. It uses the canvas tag so the snow wont collect in IE8 or lower. To enable collection you can do the following</p>
<pre><code class="javascript language-javascript">snowfall({collection : 'element'});
</code></pre>
<p>Element can be either a class or id or a list such as</p>
<pre><code class="javascript language-javascript">$(document).snowfall({collection : '.elements'});
$(document).snowfall({collection : '#element'});
</code></pre>
<p>That's pretty much it for new options below is the standard way of using the plugin.</p>
<p><strong>Invoking the snow</strong></p>
<pre><code class="javascript language-javascript">$(document).snowfall();
$('#elementid').snowfall({flakeCount : 100, maxSpeed : 10});
$('.class').snowfall({flakeCount : 100, maxSpeed : 10});
</code></pre>
<p><strong>Snowfall Methods</strong></p>
<pre><code class="javascript language-javascript">// stopping the snow
$(document).snowfall('clear');
$('#elementid').snowfall('clear');
$('.class').snowfall('clear');
</code></pre>
<p><strong>Options currently supported with default values</strong></p>
<pre><code class="javascript language-javascript">options = {
    flakeCount : 35, // number
    flakeColor : '#ffffff', // string
    flakeIndex: 999999, // number
    minSize : 1, // number
    maxSize : 3, // number
    minSpeed : 2, // number
    maxSpeed : 3, // number
    round : false, // bool
    shadow : false, // bool
    collection : 'element' // string
};
</code></pre>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[My entry for js1k #3]]></title>
            <link>https://somethinghitme.com/2011/04/24/my-entry-for-js1k-3/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/04/24/my-entry-for-js1k-3/</guid>
            <pubDate>Sun, 24 Apr 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[I share what I ended up submitting for JS1k #3 and the ideas I tried before landing on it. The final entry is a tiny terrain-ish height line mixed with a wave effect, squeezed into 1k. ]]></description>
            <content:encoded><![CDATA[<p>Below is what I ended up settling on for an entry for the JS1k.</p>
<p>My ideas ranged for a rainbow road (similar to the Mario Kart level), to a 3d tombstone that said dysentery, a terrain generator, then a wave generator.</p>
<p>I ended up just combining the last two ideas and came up with below.</p>
<canvas id="terCanvas"></canvas>
<script src="/2011/04/24/my-entry-for-js1k-3/js/tersub.js"></script>
<p>Theres really no terrain generation, its just the y value set to a random height. I just didn't have the room in 1k to fit it in unfortunately.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[CSS3 Animations are Fun!]]></title>
            <link>https://somethinghitme.com/2011/03/14/css3-animations-are-fun/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2011/03/14/css3-animations-are-fun/</guid>
            <pubDate>Mon, 14 Mar 2011 00:00:00 GMT</pubDate>
            <description><![CDATA[I built a timed rotary counter using only CSS3 animations, no images and no JavaScript. The post covers the looping trick and links the demo.]]></description>
            <content:encoded><![CDATA[<p>So I decided to try out webkits css3 animations. Been seeing cool things crop up lately and I wanted to try my hand at doing my own animations, and see what they are capable of. I came up with a timed rotary counter. The below example uses no images, or javascript, its all css. I cant wait until this is standard.. no more clunky markup for shadows, or creating gradients in photoshop.</p>
<p><a href="http://www.somethinghitme.com/projects/rotary/"><img src="/2011/03/14/css3-animations-are-fun/images/rotary.webp" alt="" title="rotary" /></a></p>
<p><a href="http://www.somethinghitme.com/projects/rotary/">Project Link</a></p>
<p>Overall the webkit css animations aren't that difficult. The trickiest part was giving the illusion of the counter looping around. I just did this by adding a 0 at the end of the element, and changing the top position back to the original value at the end of the animation.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JS1k Christmas submission]]></title>
            <link>https://somethinghitme.com/2010/12/08/js1k-xmas-submission/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/12/08/js1k-xmas-submission/</guid>
            <pubDate>Thu, 09 Dec 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[JS1k Christmas submission]]></description>
            <content:encoded><![CDATA[<p>Wanted to submit something that was just graphical this time around so I worked on a 3D Christmas Tree for my submission. The hardest thing was trying to pack a 3D engine with depth sorting and lighting into such a small package then of course I had to create the shapes for the tree and star. I got that and was happy but was told by my friends I should include snow.. so back to the drawing board. One thing that really helped was using the trick from the <a href="http://marijnhaverbeke.nl/js1k/">bouncing beholder demo</a> from the first JS1K compo.</p>
<p>If you are running a modern browser (not IE8 or below) then below you should see what my submission ended up being.</p>
<canvas id="tree"></canvas>
<script type="text/javascript" src="/2010/12/08/js1k-xmas-submission/js/finalTree.js"></script>
<p>Of course how it always goes a few hours before there was a pretty awesome Christmas Tree submitted by Roman Cortes <a href="http://js1k.com/2010-xmas/demo/848">http://js1k.com/2010-xmas/demo/848</a> lol mine is about 1995, where his is really modern looking.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[jQuery Snowfall Plugin 1.4]]></title>
            <link>https://somethinghitme.com/2010/12/09/jquery-snowfall-plugin-1-4/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/12/09/jquery-snowfall-plugin-1-4/</guid>
            <pubDate>Thu, 09 Dec 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Access an updated version of the jQuery Snowfall plugin, offering new features like rounded flakes and shadows. Learn how to invoke the snowfall effect, clear the snow, and customize various options. Download the plugin and enhance your website with a touch of winter magic.]]></description>
            <content:encoded><![CDATA[<p><strong><a href="http://www.somethinghitme.com/2011/10/05/jquery-snowfall-1-5-update-now-with-snow-buildup/">Newer version available</a></strong></p>
<p>&nbsp;</p>
<p>Added a few new things, you can now make flakes rounded (Thanks Luke), and give them shadows (for lighter colored pages) - thanks for the idea Yutt. Also I fixed some bugs that cause horizontal bar flickering (I hope).</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2010/12/snowfall.jquery.zip">Download jQuery Snowfall 1.4</a></p>
<p><strong>Invoking the snow</strong></p>
<pre><code class="javascript language-javascript">$(document).snowfall(); 
$('#elementid').snowfall({flakeCount : 100, maxSpeed : 10}); 
$('.class').snowfall({flakeCount : 100, maxSpeed : 10}); 
</code></pre>
<p><strong>Snowfall Methods</strong></p>
<pre><code class="javascript language-javascript">// stopping the snow 
$(document).snowfall('clear'); 
$('#elementid').snowfall('clear'); 
$('.class').snowfall('clear');
</code></pre>
<p><strong>Options currently supported with default values</strong></p>
<pre><code class="javascript language-javascript">options = { 
    flakeCount : 35, // number 
    flakeColor : '#ffffff', // string 
    flakeIndex: 999999, // number 
    minSize : 1, // number 
    maxSize : 3, // number 
    minSpeed : 2, // number 
    maxSpeed : 3, // number 
    round : false, // bool 
    shadow : false // bool 
    };
</code></pre>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Jquery Snowfall script updated]]></title>
            <link>https://somethinghitme.com/2010/11/25/jquery-snowfall-script-updated/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/11/25/jquery-snowfall-script-updated/</guid>
            <pubDate>Thu, 25 Nov 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[No description]]></description>
            <content:encoded><![CDATA[<p><strong><a href="http://www.somethinghitme.com/2011/10/05/jquery-snowfall-1-5-update-now-with-snow-buildup/">Newer version available</a></strong></p>
<p>Fixed a quick bug in the snowfall script, and added an example&nbsp;usage&nbsp;file in the download. Also implemented the changes suggested by Han Bongers, which allows the snow to ignore padding.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2010/11/snowfall.jquery.zip">Updated download</a></p>
<p><a href="http://www.somethinghitme.com/2010/04/29/jquery-snowfall-plugin-1-3/">Link to the project post</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Use built in jQuery UI icon with datepicker]]></title>
            <link>https://somethinghitme.com/2010/10/06/use-built-in-jquery-ui-icon-with-datepicker/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/10/06/use-built-in-jquery-ui-icon-with-datepicker/</guid>
            <pubDate>Wed, 06 Oct 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Discover a solution for integrating jQuery UI icons with the datepicker plugin. Utilize the showOn and next functions to create a fully themed calendar button without relying on an input field. Simplify the implementation of date pickers and enhance the visual appeal of your user interface.]]></description>
            <content:encoded><![CDATA[<p>Needed the date picker in a project today and noticed it doesn't integrate well with jQuery UI's icons, if trying to use an icon to open the calendar rather than an input. Found a response on <a href="http://stackoverflow.com/questions/802379/use-jquery-ui-datepicker-with-icons-from-jquery-ui-theme">Stackoverflow</a> that talked about having to do it manually. This is the solution I ended up using.</p>
<pre><code class="javascript language-javascript"> $("#DateFrom")
    .datepicker({ showOn: 'button'})
    .next('button').text('')
    .button({icons:{primary : 'ui-icon-calendar'}});
</code></pre>
<p>By default the datepicker button call automatically inserts three ellipses to the button, so the text('') is needed to remove the text from the default button. So there you go a fully themed calendar button. Now if only they would make this easier by having the datepicker do it all for you.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Got a kindle]]></title>
            <link>https://somethinghitme.com/2010/09/28/got-a-kindle/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/09/28/got-a-kindle/</guid>
            <pubDate>Tue, 28 Sep 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Well I got a Kindle 3 for my birthday today, I had one last year for a little bit but had to give it back to work, since then I've found myself wanting another. First thing I tried (besides a web IRC) were some of my canvas demos on the experimental browser that ships with the Kindle. They all seemed to work, just VERY slowly...]]></description>
            <content:encoded><![CDATA[<p>Well I got a Kindle 3 for my birthday today, I had one last year for a little bit but had to give it back to work, since then I've found myself wanting another. First thing I tried (besides a web IRC) were some of my canvas demos on the experimental browser that ships with the Kindle. They all seemed to work, just VERY slowly, for instance my JS1k grapple submission was in slow motion, but still playable for the most part. This got me thinking that this device could easily do some turn based games! Of course.. I get an ebook reader and my first thought turns to games. Turns out there are a few games for it out already, but every device could use more. Maybe that will be my next project.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[A New look]]></title>
            <link>https://somethinghitme.com/2010/09/26/a-new-look/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/09/26/a-new-look/</guid>
            <pubDate>Mon, 27 Sep 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Was a bit sick of the older design, it had some weird issues plus honestly I really began to hate it. I am liking this one a lot more, kept the whole light bulb concept from the old design, but other than that pretty much everything else is different. Wanted to incorporate text shadows too, I think they look slick in modern browsers...]]></description>
            <content:encoded><![CDATA[<p>Was a bit sick of the older design, it had some weird issues plus honestly I really began to hate it. I am liking this one a lot more, kept the whole light bulb concept from the old design, but other than that pretty much everything else is different. Wanted to incorporate text shadows too, I think they look slick in modern browsers. It also gave me a chance to check out how themes are done in Wordpress 3.0, they seem easier, and the CSS is&nbsp;definitely&nbsp;much cleaner. All I needed to do was modify the default 2010 design slightly, and I needed to make maybe 5 markup changes overall.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[jCrumb Instant Breadcrumb plugin]]></title>
            <link>https://somethinghitme.com/2010/09/24/jcrumb-instant-breadcrumb-plugin/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/09/24/jcrumb-instant-breadcrumb-plugin/</guid>
            <pubDate>Fri, 24 Sep 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Just finished up a new plugin for jQuery. I wanted some breadcrumbs for some pages but wanted to do it all client side, so I came up with jCrumb. jCrumb saves the link and title of the most recent page and adds it to a session cookie, creating a dynamic bread crumb navigation bar on the page. It uses jQuery...]]></description>
            <content:encoded><![CDATA[<p>Just finished up a new plugin for jQuery. I wanted some breadcrumbs for some pages but wanted to do it all client side, so I came up with jCrumb. jCrumb saves the link and title of the most recent page and adds it to a session cookie, creating a dynamic bread crumb navigation bar on the page. It uses jQuery, and can also use jQuery UI for styling, or custom styles created by the user.</p>
<p><a href="http://www.somethinghitme.com/projects/jCrumb/index.html">Live Demo</a></p>
<p><a href="http://plugins.jquery.com/project/jCrumb">jQuery plugin page</a></p>
<p><a href="http://code.google.com/p/jcrumb/">Google Code Page</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JavaScript time between dates]]></title>
            <link>https://somethinghitme.com/2010/09/21/javascript-time-between-dates/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/09/21/javascript-time-between-dates/</guid>
            <pubDate>Tue, 21 Sep 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[A person asked a question in my post about sorting dates in Javascript, basically on how to return a measurement of time between dates, such as days, hours, minutes, seconds. I haven't really ever had to do something like this so I figured I would see if it was as easy as I assumed it would be in JS...]]></description>
            <content:encoded><![CDATA[<p>A person asked a question in my <a href="http://www.somethinghitme.com/2010/04/12/javascript-sorting-by-date-time/">post about sorting dates in Javascript</a>, basically on how to return a measurement of time between dates, such as days, hours, minutes, seconds. I haven't really ever had to do something like this so I figured I would see if it was as easy as I assumed it would be in JS. This is what I came up with.</p>
<pre><code class="javascript language-javascript">var dob = new Date("9/28/1982"), 
    today = new Date("9/21/2010");

// Days between dates 
alert((today-dob)/86400000);

// Years between dates 
alert(((today-dob)/86400000)/365);
</code></pre>
<p>Returns pretty accurate results, I'm not accounting for leap years so it thinks I'm already 28 even though I still have a few days to go.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[New js1k Submission JSGrapple]]></title>
            <link>https://somethinghitme.com/2010/09/08/new-js1k-submission-jsgrapple/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/09/08/new-js1k-submission-jsgrapple/</guid>
            <pubDate>Wed, 08 Sep 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Update Submission for the js1k competition. My 3rd, and final one only the last one you enter is judged and I think this is going to be as good as it gets from me that is. I ended up settling on a clone of a cool game I used to play when I was a network admin in the Air Force called Wire Hang Redux...]]></description>
            <content:encoded><![CDATA[<p><a href="http://js1k.com/demo/755">Update Submission</a> for the <a href="js1k.com">js1k</a> competition. My 3rd, and final one only the last one you enter is judged and I think this is going to be as good as it gets from me that is. I ended up settling on a clone of a cool game I used to play when I was a network admin in the Air Force called <a href="http://www.gingerbeardman.com/wirehang/">Wire Hang Redux</a>.</p>
<p>This entry was more of a challenge than my <a href="http://js1k.com/demo/591">previous one</a>, I had to not only make it look presentable but also had to worry about&nbsp;game play, simple physics, and of course lack of bugs. I think it turned out pretty well, and I owe a big thanks to the Google Closure Compiler, it&nbsp;definitely&nbsp;made things easier. The biggest challenge was trying to decide on what features to add. I had a choice between keeping the high score and allowing users to try again (without refresh) , or the option of making it harder the higher they go. I chose the latter which I think was a good decision.</p>
<p>Some things I learned from the contest,</p>
<ul>
<li>pre calculated values use much less space, (.017 uses much less space than pi/180)</li>
<li>There are shorter ways to get an element through the dom than getElementById</li>
<li>You can make something cool and fun in 1k using Javascript</li>
</ul>
<p>I think the next thing I will do is make a bigger/better/cooler version.</p>
<p>Now just imagine if I had 640k to work with!</p>
<canvas id="c" width="256" height="512"></canvas>
<script type="text/javascript" src="/2010/09/08/new-js1k-submission-jsgrapple/js/grapple.js"></script>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JS1k Submission]]></title>
            <link>https://somethinghitme.com/2010/08/29/js1k-submission/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/08/29/js1k-submission/</guid>
            <pubDate>Sun, 29 Aug 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Theres a javascript 1k competition going on here the rules are simple make something using only javascript in under 1k. It can be minified, whatever just as long as its 1024 bytes or smaller. This is what I submitted (Caution could cause seizures, and vomiting!). You can only submit one thing which kind of sucks...]]></description>
            <content:encoded><![CDATA[<p>Theres a javascript 1k competition going on <a href="http://js1k.com">here</a> the rules are simple make something using only javascript in under 1k. It can be minified, whatever just as long as its 1024 bytes or smaller. <a href="http://js1k.com/demo/556">This is what I submitted</a> (Caution could cause seizures, and vomiting!). You can only submit one thing which kind of sucks, and after looking at the other demos submitted it makes me want to submit something a bit cooler. &nbsp;Definitely&nbsp;a lot of talent in the competition, cannot wait to see what the results are. Also many of the authors posted the original source which is very handy for poking around and learning some cool new things.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JSLander completed]]></title>
            <link>https://somethinghitme.com/2010/07/03/jslander-completed/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/07/03/jslander-completed/</guid>
            <pubDate>Sun, 04 Jul 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[ Finally sat down this weekend and completed my Javascript Lunar Lander clone, JSLander. Decided to make it after messing around with midpoint displacement towards the end of last year. The development of JSLander overall wasn't too bad, the trickiest thing was making everything work exactly the same when you were zoomed in...]]></description>
            <content:encoded><![CDATA[<p>Finally sat down this weekend and completed my Javascript Lunar Lander clone, JSLander. Decided to make it after messing around with midpoint displacement towards the end of last year. The development of JSLander overall wasn't too bad, the trickiest thing was making everything work exactly the same when you were zoomed in, &nbsp;I happen to be horrible at math…</p>
<p><a href="http://www.somethinghitme.com/projects/jslander/">Check out the finished product here.</a></p>
<p><a href="http://www.somethinghitme.com/projects/jslander/download/jslander.zip">Download Source</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Cellular Texture Generation with JavaScript and Canvas]]></title>
            <link>https://somethinghitme.com/2010/07/01/texture-generation-js-canvas/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/07/01/texture-generation-js-canvas/</guid>
            <pubDate>Fri, 02 Jul 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Been messing with canvas again, and put together a little demo that creates procedural cell looking textures, based off of the Worley algorithm. You can achieve some pretty amazing results, also added the option to animate, but since the algorithm has not been optimized yet you have to keep the dimensions and number of points low..."]]></description>
            <content:encoded><![CDATA[<p>Been messing with canvas again, and put together a little demo that creates procedural cell looking textures, based off of the Worley algorithm. You can&nbsp;achieve&nbsp;some pretty amazing results, also added the option to animate, but since the algorithm has not been optimized yet you have to keep the dimensions and number of points low. Also need to implement tiling. Heres a few examples of what you can produce with some minor changes in distance calculation for points. <a href="http://somethinghitme.com/projects/cell/" title="Worley Texture Generator">You can check out the generator here.</a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2010/07/cellp.png"><img src="/2010/07/01/texture-generation-js-canvas/images/cellp.webp" alt="" title="cellp" /></a><a href="http://www.somethinghitme.com/wp-content/uploads/2010/07/cellg.png"><img src="/2010/07/01/texture-generation-js-canvas/images/cellg.webp" alt="" title="cellg" /></a><a href="http://www.somethinghitme.com/wp-content/uploads/2010/07/cellyell.png"><img src="/2010/07/01/texture-generation-js-canvas/images/cellyell.webp" alt="" title="cellyell" /></a><a href="http://www.somethinghitme.com/wp-content/uploads/2010/07/cell.png"><img src="/2010/07/01/texture-generation-js-canvas/images/cell.webp" alt="" title="Cellular Texture" /></a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Michiganwakeup.com Site Design]]></title>
            <link>https://somethinghitme.com/2010/06/24/michiganwakeup-com-site-design/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/06/24/michiganwakeup-com-site-design/</guid>
            <pubDate>Fri, 25 Jun 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Just finished up another site for a client, http://www.michiganwakeup.com. They were very pleased with it. They asked for a site that was very simple and to the point. I still feel as if there is something missing.. but I had a 48-hour turnaround time for this so I had to get developing pretty fast on the design...]]></description>
            <content:encoded><![CDATA[<p>Just finished up another site for a client, <a href="http://www.michiganwakeup.com">http://www.michiganwakeup.com</a> . They were very pleased with it. They asked for a site that was very&nbsp;simple&nbsp;and to the point. I still feel as if there is something missing.. but I had a 48 hour turn around time for this so I had to get developing pretty fast on the design. I guess there is always Wake Up Michigan 2011.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[DSx86 is awesome!]]></title>
            <link>https://somethinghitme.com/2010/06/08/dsx86-is-awesome/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/06/08/dsx86-is-awesome/</guid>
            <pubDate>Tue, 08 Jun 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[DSx86 is awesome! I don't know what it is but something about old dos games on handheld systems excites me, I think its because even those old games seem to have more depth and content than many of the current games in the handheld market...]]></description>
            <content:encoded><![CDATA[<p>I don't know what it is but something about old dos games on handheld systems excites me, I think its because even those old games seem to have more depth and content than many of the current games in the handheld market. Of course there are some awesome handheld games with&nbsp;incredible&nbsp;depth and content like Monster Hunters Freedom, or Advanced wars, but games that awesome are far and few between. &nbsp;So I was pretty excited when I recently saw <a href="http://dsx86.patrickaalto.com/">DSx86 a 80286 emulator for the nintendo DS by Patrick Alto.</a></p>
<p>So far the emulator just supports the 80286 with a few 80386 opcodes, but no plans to fully emulate a 80386 which is understandable, but even a 286 opens up a ton of opportunities for old school gaming. I can now play games such as <a href="http://en.wikipedia.org/wiki/Elite_(video_game)">Elite Plus</a>, <a href="http://en.wikipedia.org/wiki/Civilization_(video_game)">Civilization (the original)</a>, <a href="http://www.mobygames.com/game/warlords">Warlords</a>, <a href="http://www.mobygames.com/game/castles-ii-siege-conquest">Castles 2</a>, and (hopefully soon) <a href="http://www.mobygames.com/game/kings-bounty">Kings Bounty</a>.</p>
<p>If this is something that interests you theres a&nbsp;<a href="http://dsx86compatibility.pbworks.com/Compatibility-List">compatibility&nbsp;list where users are encouraged to test games to help out the development.</a> Of course you'll need some sort of DS card with custom firmware such as the R4 or Cyclo DS (my personal choice).</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[JavaScript Canvas Lightning Effect]]></title>
            <link>https://somethinghitme.com/2010/05/25/javascript-canvas-lightning-effect/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/05/25/javascript-canvas-lightning-effect/</guid>
            <pubDate>Tue, 25 May 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Like always still messing around creating random things using JavaScript and the Canvas element. My most recent side project was implementing some Action Script lightning code posted by Rybar over on the Flixel forums. Here is what I came up with...]]></description>
            <content:encoded><![CDATA[<p>Like always still messing around creating random things using JavaScript and the Canvas element. My most recent side project was implementing some Action Script lightning code posted by Rybar over on the Flixel forums. Here is what I came up with <a href="http://www.somethinghitme.com/projects/canvaslightning/">http://www.somethinghitme.com/projects/canvaslightning/</a>. Theres&nbsp;definitely&nbsp;a lot to be desired. Was trying to think of some cool things to do with it. It's a work in progress until a good idea comes to me.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[New Design for Mio Ausable Schools]]></title>
            <link>https://somethinghitme.com/2010/05/25/new-design-for-mio-ausable-schools/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/05/25/new-design-for-mio-ausable-schools/</guid>
            <pubDate>Tue, 25 May 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Just finished up a design for a client Mio Ausable Schools. I think it turned out pretty well. One of the funny things is this is the High School I actually went to oh so many years ago, a place where I flexed my brain technology wise...]]></description>
            <content:encoded><![CDATA[<p>Just finished up a design for a client Mio Ausable Schools. I think it turned out pretty well. One of the funny things is this is the High School I actually went to oh so many years ago, a place where I flexed my brain technology wise. I used to spend over half of the day being the IT Directors assistant.</p>
<p><a href="http://www.mio.k12.mi.us/">http://www.mio.k12.mi.us/</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[MySQL Stored Procedures IF NOT EXISTS()]]></title>
            <link>https://somethinghitme.com/2010/05/06/mysql-stored-procedures-if-not-exists/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/05/06/mysql-stored-procedures-if-not-exists/</guid>
            <pubDate>Thu, 06 May 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[I have been using MSSQL with ASP.NET a lot lately, and I really wanted to get some of the benefits of stored procedures into a PHP application I'm writing. I've known MySQL has supported them for a while but I guess I was always a bit too lazy...]]></description>
            <content:encoded><![CDATA[<p>I have been using MSSQL with ASP.NET a lot lately, and I really wanted to get some of the benefits of stored procedures into a PHP application I'm writing. I've known MySQL has supported them for a while but I guess I was always a bit too lazy to go through old code and convert it. I used the tool <a href="http://www.heidisql.com/">HeidiSQL</a> to make the process a bit more painless.</p>
<p>The first stored procedure I attempted to write accepted 3 parameters and based on one of them checks a lookup table, and creates a new value in it if the same value does not already exist. Normally I would use an IF NOT EXISTS clause, which in Microsoft SQL would look like this</p>
<pre><code class="sql language-sql">CREATE PROCEDURE someProc
@SomeParam varchar(50),
AS
BEGIN
    DECLARE @SomeId int

    IF  NOT EXISTS(SELECT (1) FROM lookup_table WHERE someField = @SomeParam )
        BEGIN
            INSERT INTO lookup_table (someField) VALUES(@someParam)
            SELECT @SomeId = @@identity
        END
    ELSE
        BEGIN
            SELECT @SomeId = id FROM lookup_table WHERE someField = @SomeParam
        END

    -- Do some other stuff here with the id you just received and other data
END
</code></pre>
<p>The above snippet would take a value, check a table for it, get its id, and if the record doesn't exist in the database create it and return the id. Then you could continue on and insert that id into another table or what have you.</p>
<p>Accomplishing the same thing with a MySQL stored procedure is a bit different. The code below shows how you would accomplish the same task.</p>
<pre><code class="sql language-sql">CREATE PROCEDURE 'someProc' (IN 'in_SomeParam' INT)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
BEGIN
    DECLARE SomeId int;
    DECLARE CheckExists int;
    SET CheckExists = 0;

    SELECT count(*) INTO CheckExists from lookup_table WHERE someField = in_SomeParam;

    IF (CheckExists &gt; 0) THEN
        SELECT id INTO SomeId FROM lookup_table WHERE someField = in_SomeParam;
    ELSE
        INSERT INTO lookup_table (someField ) VALUES(in_SomeParam);
        SELECT SomeId = LAST_INSERT_ID();
    END IF;

    # Do some other stuff here with the id you just received and other data
END;
</code></pre>
<p>I'm sure I will find some more differences in things I am used to doing with stored procedures using T-SQL, and when I do I'll post them here.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Minecraft fun and editing]]></title>
            <link>https://somethinghitme.com/2010/05/02/minecraft-fun-and-editing/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/05/02/minecraft-fun-and-editing/</guid>
            <pubDate>Sun, 02 May 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[ Recently came across this awesome java game Minecraft basically the whole goal of the game (multiplayer that is) is to create and destroy things. At first I was pretty skeptical, the concept is so simple.. until I found myself spending hours recreating Mario...]]></description>
            <content:encoded><![CDATA[<p>Recently came across this awesome java game <a href="http://minecraft.net">Minecraft</a> basically&nbsp;the whole goal of the game (multiplayer that is) is to create and destroy things. At first I was pretty skeptical, the concept is so simple.. until I found myself spending hours recreating Mario, and others pixel by pixel, and creating a staircase to lava.</p>
<p>[caption id="attachment_207" align="aligncenter" width="426" caption="Mario brothers in Minecraft"]<a href="http://www.somethinghitme.com/wp-content/uploads/2010/05/mario.png"><img src="/2010/05/02/minecraft-fun-and-editing/images/mario.webp" alt="" title="mario" /></a>[/caption]</p>
<p>[caption id="attachment_208" align="aligncenter" width="426" caption="Stairs to Lava"]<a href="http://www.somethinghitme.com/wp-content/uploads/2010/05/stairs.png"><img src="/2010/05/02/minecraft-fun-and-editing/images/stairs.webp" alt="" title="Stairs to Lava" /></a>[/caption]</p>
<p>Don't let the look of the game fool you, anyone no matter the age group can easily become addicted.</p>
<p>What really piqued my interest are some of the game modes people have put together, such as a zombie mode where you are chased by zombies (other players who have been turned) and you need to either hide, or build your way away from them. Theres also a falling lava mode where lava fills the level and you need to build structures as to not get stuck in it.</p>
<p>What I really wanted to do was create some of my own game modes, but it was pretty hard to even figure out where to begin. I eventually settled on <a href="http://opencraft.sourceforge.net/">Opencraft</a>, which is an opensource Java server for the game. It looks like development has ceased so I have had to implement a few things already. I plan on releasing any changes I make so others can create some interesting game modes as well.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Jquery Snowfall Plugin 1.3]]></title>
            <link>https://somethinghitme.com/2010/04/29/jquery-snowfall-plugin-1-3/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/29/jquery-snowfall-plugin-1-3/</guid>
            <pubDate>Fri, 30 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Plugin has been updated to 1.4 please go here for more up to date information. Updated fixed a bug, and added an example file to show how to use the plugin. Added a few new things to the Jquery snowfall plugin, you now have the ability to clear the snow from elements..]]></description>
            <content:encoded><![CDATA[<h2 id="pluginhasbeenupdatedto14pleasegohereformoreuptodateinformationhttpwwwsomethinghitmecom20101209jquerysnowfallplugin14"><a href="http://www.somethinghitme.com/2010/12/09/jquery-snowfall-plugin-1-4/"><strong>Plugin has been updated to 1.4 please go here for more up to date information</strong></a></h2>
<p>*Updated* fixed a bug, and added an example file to show how to use the plugin.</p>
<p>Added a few new things to the Jquery snowfall plugin, you now have the ability to clear the snow from elements, chaining is supported, and element matching is supported. Its funny today was the hottest day of the year so far and I decided to work on a script to make it snow.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2010/11/snowfall.jquery.zip">Download Jquery Snowfall 1.3.1</a></p>
<p><strong>Invoking the snow</strong></p>
<p>[sourcecode language="js"] $(document).snowfall(); $('#elementid').snowfall({flakeCount : 100, maxSpeed : 10}); $('.class').snowfall({flakeCount : 100, maxSpeed : 10}); [/sourcecode]</p>
<p><strong>Snowfall Methods</strong></p>
<p>[sourcecode language="js"] // stopping the snow $(document).snowfall('clear'); $('#elementid').snowfall('clear'); $('.class').snowfall('clear'); [/sourcecode]</p>
<p><strong>Options currently supported with default values</strong></p>
<p>[sourcecode language="js"] options = { flakeCount : 35, // number flakeColor : '#ffffff', // string flakeIndex: 999999, // number minSize : 1, // number maxSize : 3, // number minSpeed : 2, // number maxSpeed : 3 // number }; [/sourcecode]</p>
<p><strong>Example</strong></p>
<script src="http://www.somethinghitme.com/wp-content/themes/somethinghitme/js/snowfall.min.jquery.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[ $(document).ready(function(){$('#snow-window').snowfall({flakeCount : 100, maxSpeed : 10}); $('#stopsnow').click(function(){ $('#snow-window').snowfall('clear')});}); // ]]]]><![CDATA[></script>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Game Related Snippets I always Forget]]></title>
            <link>https://somethinghitme.com/2010/04/26/game-related-snippets-i-always-forget/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/26/game-related-snippets-i-always-forget/</guid>
            <pubDate>Mon, 26 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[When I sit down to prototype something new I always find myself looking up the same snippets to do the same types of things. I figured I might as well record them somewhere so I know an easy place to look when I do forget. All the samples will be in Javascript and should be able to be easily converted to any other language...]]></description>
            <content:encoded><![CDATA[<p>When I sit down to prototype something new I always find myself looking up the same snippets to do the same types of things. I figured I might as well record them somewhere so I know an easy place to look when I do forget. All the samples will be in&nbsp;Javascript and should be able to be easily converted to any other language.</p>
<p><strong>Distance Formula</strong></p>
<p>Obviously a pretty important one, used to tell the distance between 2 objects. Can be used for simple radius collisions as well.</p>
<pre><code class="javascript language-javascript"> var distance = Math.sqrt((x2 - x1) *(x2-x1) + (y2 - y1) * (y2-y1));
</code></pre>
<p><strong>Move toward an object (Without rotation) with easing</strong></p>
<pre><code class="javascript language-javascript"> x += (targetX-x)/speed; y += (targetY-y)/speed;
</code></pre>
<p><strong>Angle Based Movement</strong></p>
<p>I always see myself needing this one, whether its for an Asteroids clone, or a follow the leader type game.</p>
<pre><code class="javascript language-javascript"> velX = Math.cos((angle * Math.PI / 180) * thrust); velY = Math.sin((angle * Math.PI / 180) * thrust);
</code></pre>
<p><strong>Friction</strong></p>
<p>How do I make something slow down if no force is applied?</p>
<pre><code class="javascript language-javascript"> velX *= .98; //Any val under 1 is suitable for your needs velY *= .98
</code></pre>
<p><strong>2D Matrix</strong></p>
<p>This is a pretty simple one I know.. but I always seem to forget it. This is how to store a 2d matrix in an array. And how to find a value you need.</p>
<pre><code class="javascript language-javascript"> // 2d matrix\[y * width + x\] var arr = \[\], width = 10;

for(x=0; x&lt;width; x++){ for(y=0; y&lt;width; y++){ arr\[y * 10 + x\] = x + y; //Or whatever value you need to assign } }

//Retrieve a value from x:5, y:2 var val = arr\[2 * 10 + 5\];

//get the x and y from a 1d array var index = 12, x = index % width, // 2 y = Math.floor(index / width); // 1
</code></pre>
<p><strong>Move towards an object at a constant speed</strong></p>
<pre><code class="javascript language-javascript"> var tx = targetX - x, ty = targetY - y, dist = Math.sqrt(tx * tx+ty * ty), rad = Math.atan2(ty,tx), angle = rad / Math.PI * 180;;

velX = (tx / dist) * thrust; velY = (ty / dist) * thrust;
</code></pre>
<p><a href="http://jsfiddle.net/loktar/6uaKd/5/">Example</a></p>
<p><strong>Project a point in front of an object</strong></p>
<pre><code class="javascript language-javascript"> x + length * Math.cos(angle * Math.PI / 180); y + length * Math.sin(angle * Math.PI / 180);
</code></pre>
<p><strong>Get the angle between objects</strong></p>
<pre><code class="javascript language-javascript"> var x = targetX - this.x, y = targetY - this.y;

return Math.atan2(x,-y);
</code></pre>
<p><strong>Plot points around a circle</strong></p>
<pre><code class="javascript language-javascript"> var rad = 500, total = 50, centerX = 250, centerY = 250;

for(var i = 0; i &lt; total; i++){
    ctx.beginPath(); ctx.moveTo(centerX,centerX);
    var x = centerX + rad * Math.cos(2 * Math.PI * i / total),
        y = centerY + rad * Math.sin(2 * Math.PI * i / total);

    ctx.lineTo(x, y); ctx.stroke(); ctx.closePath();
}
</code></pre>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Quick Sort algorithm comparison]]></title>
            <link>https://somethinghitme.com/2010/04/21/quick-sort-algorithm-comparison/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/21/quick-sort-algorithm-comparison/</guid>
            <pubDate>Wed, 21 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[I've been trying to do regular programming exercises lately just to stay sharp and recently I decided to take on sorting algorithms. I used my current language of choice (javascript) and set out to implement the quick sort algorithm. Below is the portion of my code that completes this...]]></description>
            <content:encoded><![CDATA[<p>I've been trying to do regular programming exercises lately just to stay sharp and recently I decided to take on sorting algorithms. I used my current language of choice (javascript) and set out to implement the <a href="http://en.wikipedia.org/wiki/Quicksort">quick sort algorithm</a>. Below is the portion of my code that completes this.</p>
<p>[sourcecode language="js"] sorting.qSort = function (sortItems, _left, _right) { var left = _left, right = _right, pivot = right;</p>
<p>if(right &gt; left){ do{ // From left for(var i = left; i &lt; pivot; i+=1){ left = i;</p>
<p>if(sortItems[i] &gt; sortItems[pivot]){ pivot = i; break; } }</p>
<p>// From right for(var i = right; i &gt; pivot; i-=1){ right = i;</p>
<p>if(sortItems[i] < sortItems[pivot]){ // swap sortItems.swap(i, pivot); pivot = i; break; } } }while((right - left) > 1);</p>
<p>this.qSort(sortItems, _left , pivot - 1); this.qSort(sortItems, pivot + 1, _right);</p>
<p>return true; }</p>
<p>return false; } [/sourcecode]</p>
<p>The funny thing is really how much quicker this was than the <a href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble sort algorithm</a>. The only benefit I can find to bubble sort is it is much faster to implement</p>
<p>[sourcecode language="js"] sorting.bubSort = function (sortItems) { for(var i = 0; i < sortItems.length; i+=1){ if(sortItems[i] > sortItems[i+1]){ //swap change the incrementor to -1 sortItems.swap(i, i+1); i=-1; } } } [/sourcecode]</p>
<p>But like many I recommend you never use it. Using quick sort and sorting 2000 items in random order I get an average of 0.08 with bubble sort this increases to 20 seconds! Also I recommend for javascript using the built in sorting function for arrays the below code beat out my implementation of quick sort everytime with an average speed of 0.01 seconds. Of course its also much easier to implement.</p>
<p>[sourcecode language="js"] sorting.internalSort = function sortNumber(a,b){ return a - b; } [/sourcecode]</p>
<p>All tests were performed in Chrome. It was a fun exercise overall and helped me brush up on my recursion skills.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[How to get the week in a month for a date with Javascript]]></title>
            <link>https://somethinghitme.com/2010/04/14/how-to-get-the-week-in-a-month-for-a-date-with-javascript/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/14/how-to-get-the-week-in-a-month-for-a-date-with-javascript/</guid>
            <pubDate>Wed, 14 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Working on my calendar application and I needed to get what week in the current month a day occurs on. Unfortunately I couldn't find anything like this in the JavaScript Date object so this is the function I came up with...]]></description>
            <content:encoded><![CDATA[<p>Working on my calendar application and I needed to get what week in the current month a day occurs on. Unfortunately I couldn't find anything like this in the JavaScript Date object so this is the function I came up with</p>
<p>[sourcecode language="js"] Date.prototype.getMonthWeek = function(){ var firstDay = new Date(this.getFullYear(), this.getMonth(), 1).getDay(); return Math.ceil((this.getDate() + firstDay)/7); } [/sourcecode]</p>
<p>Thanks to mutilator for helping out with the actual math to figure it out.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Canvas Lunar Lander update]]></title>
            <link>https://somethinghitme.com/2010/04/11/canvas-lunar-lander-update/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/11/canvas-lunar-lander-update/</guid>
            <pubDate>Mon, 12 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Game is still coming along, it now supports zooming, which was actually a little bit tricky to figure out. Only a few more things left to add before its a full fledged game.. or clone of a game that is. Check out the progress of JSLander. Now supported in any browser that supports the canvas element...]]></description>
            <content:encoded><![CDATA[<p>Game is still coming along, it now supports zooming, which was actually a little bit tricky to figure out. Only a few more things left to add before its a full fledged game.. or clone of a game that is.</p>
<p>Check out the progress &nbsp;of <a href="http://www.somethinghitme.com/projects/jslander/">JSLander</a></p>
<p><strong>Now supported in any browser that supports the canvas element.</strong></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Javascript Sorting by date time]]></title>
            <link>https://somethinghitme.com/2010/04/12/javascript-sorting-by-date-time/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/12/javascript-sorting-by-date-time/</guid>
            <pubDate>Mon, 12 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[I'm currently working on a web based calendar and I needed to sort my event object by date real quick. So the first thing I did was a quick search on sorting an object by date time. Google becomes such second nature I immediately think of doing that first sometimes before fleshing out a whole solution in my mind...]]></description>
            <content:encoded><![CDATA[<p>I'm currently working on a web based calendar and I needed to sort my event object by date real quick. So the first&nbsp;thing&nbsp;I did was a quick search &nbsp;on sorting an object by date time. Google becomes such second nature I&nbsp;immediately&nbsp;think of doing that first sometimes before fleshing out a whole solution in my mind. The first result I was brought to was <a href="http://javascript.about.com/library/blsort3.htm">this page</a> on about.com. While the authors solution will work I thought why do even need this complexity? This is what I came up with when I stepped away from Google realizing this was a very trivial task</p>
<p>[sourcecode language="js"]/* * Function : sortDate(Date, Date) * Description : Sorts an object based on date */ function sortDate(a,b) { var a = new Date(a.startDateTime), b = new Date(b.startDateTime); return (a.getTime() - b.getTime()); } [/sourcecode]</p>
<p>My object has a property called startDateTime, but this can easily be modified. All I do is a quick comparison of the UNIX time stamp and its sorted. Mainly just hoping this eventually ranks higher than the result I found on Google.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Lunar Lander Canvas Game]]></title>
            <link>https://somethinghitme.com/2010/04/07/lunar-lander-canvas-game/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/04/07/lunar-lander-canvas-game/</guid>
            <pubDate>Thu, 08 Apr 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Working on a lot of things lately but noticed I haven't made a post in quite a while. Heres a quick look at one of the random games I'm making using JavaScript and the Canvas element. Its essentially a clone of Lunar Lander. As it is right now you can't actually crash, and if you successfully land on one of the pads, you drop from the top again...]]></description>
            <content:encoded><![CDATA[<p>Working on a lot of things lately but noticed I haven't made a post in quite a while. Heres a quick look at one of the random games I'm making using&nbsp;JavaScript&nbsp;and the Canvas element. Its essentially a clone of <a href="http://en.wikipedia.org/wiki/Lunar_Lander_(video_game)" title="Lunar Lander">Lunar Lander</a>. &nbsp;As it is right now you can't actually crash, and if you&nbsp;successfully&nbsp;land on one of the pads, your drops from the top again. &nbsp;I'm not sure yet if I'm going to add the zoom effect when you get close to the landing pads, I think its pretty cool looking as a full page game. I imagine making a bunch of lander automated and having it set as the background to a gaming page.. of course it will only work in modern browsers at this time.</p>
<p><a href="http://www.somethinghitme.com/projects/jslander/">Check it out here</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Dynamic rotated sprite sheets with JavaScript]]></title>
            <link>https://somethinghitme.com/2010/02/06/dynamic-rotated-sprite-sheet-with-javascripts/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/02/06/dynamic-rotated-sprite-sheet-with-javascripts/</guid>
            <pubDate>Sun, 07 Feb 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[Been working on the single player canvas game this week and got a few cool things accomplished in terms of performance. The main thing I was working on was trying to reduce the slowdown on real time image rotation. What I ended up coming up with was creating rotated sprite sheets on the fly in memory...]]></description>
            <content:encoded><![CDATA[<p>Been working on the single player canvas game this week and got a few cool things accomplished in terms of performance. The main thing I was working on was trying to reduce the slowdown on real time image rotation.&nbsp; What I ended up coming up with was creating rotated sprite sheets on the fly in memory.</p>
<p>The method is pretty simple, here's how it works. I start out with a sprite sheet that contains the characters animation frames all facing on direction. I take that and rotate it in increments of degrees (I chose 23) and render&nbsp; all of the results to a new sprite sheet in memory. What you end up with is a pretty large sprite sheet of every animation at each angle increment. So instead of 1 line of animation of the character facing upward I now have 16 lines of animations each one facing a different angle. What this allows me to do is take the angle my sprite needs to face, and just go to that section of the sprite sheet for the animations. Doing it this way requires no real time rotation in game. Performance gains were immediately seen. In Chrome I was able to go from 150 zombies on screen (which showed some slowdown) to 800 zombies before any slowdown occurred. In Firefox the results were a little disappointing, I did gain an increase but not much of one.&nbsp; Take a look for yourself, the first link has 150 zombies using realtime rotation, the 2nd link has pre-rendered rotations with 200 zombies.</p>
<p><a href="http://www.somethinghitme.com/projects/rottest/">Realtime rotation</a></p>
<p><a href="http://www.somethinghitme.com/projects/prerotation/">Pre rotated sprite sheet</a></p>
<p>There is a drawback to this method of course, the main drawbacks are increased load time and higher memory usage.&nbsp; For me though these do not outweigh the benefit of more on the screen at once at playable frame rates.</p>
<p><a href="http://www.somethinghitme.com/projects/rotatedimage/rotateImage.html">Here's a quick demo</a> showing the results of whats going on. It takes a second to load,</p>
<p>And <a href="http://www.somethinghitme.com/projects/rotatedimage/rotateImage.js">heres a link to the code</a> if anyone is interested. I tied certain numbers to some things that should be variables instead, just note with Firefox you may have issues because getImageData is not always equal to the size of the canvas, which causes errors with putImageData if any data is being put outside the bounds of the canvas object. To fix this I generally add a bit on the width and height of my canvas on creation.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[New Canvas game im working on]]></title>
            <link>https://somethinghitme.com/2010/02/01/new-canvas-game-im-working-on/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2010/02/01/new-canvas-game-im-working-on/</guid>
            <pubDate>Tue, 02 Feb 2010 00:00:00 GMT</pubDate>
            <description><![CDATA[A while back I posted a link to a Flash game I was working on, it was going to be multiplayer using Nanoba. Unfortunately I gave up on it pretty quickly, I'm not a big fan of Flash and I wanted to learn something totally different, so I decided to try and remake the game using Canvas...]]></description>
            <content:encoded><![CDATA[<p>A while back I posted a link to a Flash game I was working on, it was going to be multiplayer using Nanoba. Unfortunately I gave up on it pretty quickly, I'm not a big fan of Flash and I wanted to learn something totally different, so I decided to try and remake the game using Canvas.</p>
<p>So far development has been going pretty well, the single player implementation in its current state can be seen here <a href="http://www.somethinghitme.com/projects/canvaszom/">http://www.somethinghitme.com/projects/canvaszom/</a> (please not the images are not free they are actually 2d renders from 3d models i have purchased, the code is under the MIT license). It already has more implemented than the Flash version had. There are quite a few things however left to be done and I will try to make a post with every major milestone and write up how I accomplished it. So far the only thing that is not using JavaScript is the sound. I am using Sound Manager for that, which uses a swf in order to generate the sounds.</p>
<p>AS of right now I have put a halt on development of this particular single player game recently because I am actually working on a multiplayer version that is nearing completion. The next post I make will most likely be releasing that and then I will get back to making this a full fledged game… and I'll most likely not use the bald shirtless men as enemies (they are supposed to be zombies!).</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Snowfall Plugin Updated]]></title>
            <link>https://somethinghitme.com/2009/12/20/snowfall-plugin-updated/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/12/20/snowfall-plugin-updated/</guid>
            <pubDate>Mon, 21 Dec 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Updated the snowfall plugin that was released yesterday with a few more features. The primary new feature allows you to specify which elements you want the snow to appear in. An example of this can be seen below. View a full page demonstration. In addition to snowing within elements there are some more options available, properties available are...]]></description>
            <content:encoded><![CDATA[<p>Updated the <a href="http://www.somethinghitme.com/wp-content/uploads/2009/12/snowfall.jquery.zip">snowfall plugin</a> that was released yesterday with a few more features.&nbsp; The primary new feature allows you to specify which elements you want the snow to appear in. An example of this can be seen below. <a href="http://www.zombietweets.com">View a full page demonstration</a></p>
<p><code>$('#snow-window').snowfall({flakeCount : 100, maxSpeed : 10});</code></p>
<p>In addition to snowing within elements there are some more options available, properties available are</p>
<p><code>flakeCount, flakeColor, flakeIndex, minSize, maxSize, minSpeed, maxSpeed</code></p>
<p>You can still initialize the plugin with</p>
<p><code>$(document).snowfall();</code></p>
<p>but the flakes will not use fixed for positioning, they will now travel down the page completely. On some long pages this will make it seem like its not "snowing" as much. I'm working on a few more updates that should be released in the following days. If you end up using this I'd love to know. You can download the most recent version <a href="http://www.somethinghitme.com/wp-content/uploads/2009/12/snowfall.jquery.zip">here</a>.</p>
<script src="http://www.somethinghitme.com/wp-content/themes/somethinghitme/js/snowfall.jquery.js" type="text/javascript"></script>
<script type="text/javascript">$('#snow-window').snowfall({flakeCount : 100, maxSpeed : 10});</script>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Jquery Snowfall plugin]]></title>
            <link>https://somethinghitme.com/2009/12/19/jquery-snowfall-plugin/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/12/19/jquery-snowfall-plugin/</guid>
            <pubDate>Sat, 19 Dec 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Plugin has been updated to 1.4 please go here for more up to date information. Got bored today and decided to put together a quick snow plugin for Jquery. On my site Undeadgames.com the members look forward to the snow every year. I decided to replace the older one we were using, it was nice overall...]]></description>
            <content:encoded><![CDATA[<h2 id="pluginhasbeenupdatedto14pleasegohereformoreuptodateinformationhttpwwwsomethinghitmecom20101209jquerysnowfallplugin14"><a href="http://www.somethinghitme.com/2010/12/09/jquery-snowfall-plugin-1-4/"><strong>Plugin has been updated to 1.4 please go here for more up to date information</strong></a></h2>
<p>Got bored today and decided to put together a quick snow plugin for Jquery. On my site <a href="http://www.undeadgames.com">Undeadgames.com</a> the members look forward to the snow every year. I decided to replace the older one we were using, it was nice overall, but ran terribly slow on some browsers, and didn't really care about window dimensions.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2009/12/snowfall.jquery.zip">Click to download the plugin</a></p>
<p>The plugin is easy to implement, load up the file and call</p>
<p><code>$(document).snowfall();</code></p>
<p>or</p>
<p><code>$(document).snowfall(number of flakes);</code></p>
<p>Overall the plugin is pretty useless, and hearkens back to the days of old. Next update will include snow collecting on specified page elements. You can see it in action on either <a href="http://www.zombietweets.com">zombietweets.com</a>, or <a href="http://www.undeadgames.com">undeadgames.com</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Terrain Generation with Canvas and JavaScript]]></title>
            <link>https://somethinghitme.com/2009/12/06/terrain-generation-with-canvas-and-javascript/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/12/06/terrain-generation-with-canvas-and-javascript/</guid>
            <pubDate>Mon, 07 Dec 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[The idea of creating height maps with JS and canvas came from an idea I started for a different website I'm developing. This small project has taught me many things (some of the unfortunate things I learned is I still suck at math, and I have many JS skills to brush up on). I just couldn't bring myself to give it up so I also implemented a very slow very light voxel engine...]]></description>
            <content:encoded><![CDATA[<p>The idea of creating height maps with JS and canvas came from an &nbsp;idea I started for a different website I'm developing.&nbsp;This small project has&nbsp;taught&nbsp;me many things (some of the unfortunate things I learned is I still suck at math, and I have many JS skills to brush up on). I just couldn't bring myself to give it up so I also implemented a very slow very light voxel engine.</p>
<p><a href="http://www.somethinghitme.com/projects/canvasterrain/">You can check out the generator here.</a> (Chrome recommended, sorry no IE)</p>
<p>The first major thing I learned was the midpoint displacement (or Diamond Square) algorithm. The&nbsp;<a href="http://en.wikipedia.org/wiki/Diamond-square_algorithm">Wikipedia&nbsp;article</a> and links contained were&nbsp;definitely&nbsp;a great help but this actually took me the longest to implement. Getting the order of &nbsp;iteration and recursion was the hardest part. I found so many examples but many of them conflicted on actual implementation. The closest example I got working was the example found on <a href="http://www.hyper-metrix.com/processing-js/docs/index.php?page=Plasma%20Fractals">this page</a> but if you try creating height maps with a lot of noise you will notice square patterns popping up, sometimes with low noise you can catch a nice one right in the center. &nbsp;This is because they do not take the center into consideration when calculating the edges. I was able to fix this in my version fortunately.</p>
<p>That ended up only being a small part of the project however, you'll notice I added shadow maps which could use some tweaking, and a very slow voxel engine. These sites greatly helped that process.</p>
<p><a href="http://www.cyberhead.de/download/articles/shadowmap/">http://www.cyberhead.de/download/articles/shadowmap/</a></p>
<p><a href="http://wiki.allegro.cc/index.php?title=Pixelate:Issue_14/Voxel_Landscape_Renderization">http://wiki.allegro.cc/index.php?title=Pixelate:Issue_14/Voxel_Landscape_Renderization</a></p>
<p>The last few things to implement are wrapping height maps, and a better color map, and some sort of progress bar. Hopefully after that my&nbsp;obsessions&nbsp;with&nbsp;height maps&nbsp;will be over for a while. These things are pretty addicting, you get such cool&nbsp;results&nbsp;from just a few numbers. Feel free to check out the code, if you have any improvements let me know, I know its by no means even close to perfect. Also if you happen to use it for anything please give credit where its due.</p>
<p>I'll most likely write up yet another midpoint displacement tutorial, because even the current ones left me scratching my head at some points. Then off to working on my canvas zombie game for <a href="http://www.zombiegames.net">zombiegames.net!</a></p>
<p>Special thanks to Yutt for testing it out and helping me work on the stupid color bug.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Quick Canvas Game]]></title>
            <link>https://somethinghitme.com/2009/03/14/quick-canvas-game/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/03/14/quick-canvas-game/</guid>
            <pubDate>Sat, 14 Mar 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[I've been hearing things about this canvas element lately and I found some really cool uses. Mostly I found examples of charts that use it, which makes sense because in some browsers its not very fast rendering real time elements onto it, and IE browsers do not natively support it. After doing some more research and seeing as its in the HTML 5 specification I figured I would try my hand at making something quick with it...]]></description>
            <content:encoded><![CDATA[<p>[caption id="attachment_38" align="alignleft" width="284" caption="Canvas Invaders"]<a href="http://www.somethinghitme.com/projects/canvasinvaders/"><img src="/2009/03/14/quick-canvas-game/images/canvasinvaders-284x300.webp" alt="" title="canvasinvaders" /></a>[/caption]</p>
<p><a href="http://www.somethinghitme.com/projects/canvasinvaders/" title="Canvas Invaders">space invaders clone</a></p>
<p>I've been hearing things about this <a href="https://developer.mozilla.org/En/Canvas_tutorial" title="canvas tutorials">canvas</a> element lately and I found some really cool uses. Mostly I found examples of charts that use it, which makes sense because in some browsers its not very fast rendering real time elements onto it, and IE browsers do not natively support it. After doing some more research and seeing as its in the HTML 5 specification I figured I would try my hand at making something quick with it. So I decided to create a quick <a href="http://www.somethinghitme.com/projects/canvasinvaders/" title="Canvas Invaders">space invaders clone</a>. For the rendering base code I used some code which shows pretty nice looking particle engine using canvas at <a href="http://iterationsix.com/particle_fountain/particle_fountain.html">iterationsix.com</a>. If you want the canvas invader files you can get them <a href="http://www.somethinghitme.com/wp-content/uploads/2009/03/canvas-invaders.zip" title="Canvas sources ">here</a></p>
<p>After completing this it really excites me the direction Javascript seems to be going. I definitely think one day in the distant future it will be able to replace Flash for most anything. Especially if browsers continue to implement faster JS engines, and MS really does ditch its IE platform.</p>
<p>For some good tutorials on using canvas check this site out, it has some&nbsp; useful information.</p>
<p><a href="https://developer.mozilla.org/En/Canvas_tutorial">https://developer.mozilla.org/En/Canvas_tutorial</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[OpenGL Screensaver]]></title>
            <link>https://somethinghitme.com/2009/02/24/opengl-screensaver/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/02/24/opengl-screensaver/</guid>
            <pubDate>Wed, 25 Feb 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Well I have finished my mess around project with OpenGL. I decided to make a screensaver BIG SURPRISE :)! Its fully functioning, with the media embedded (1 image) but it requires the 2 tao DLL's in order to run. Also I went ahead and included the source. Its no big secret how to create a screensaver in C# but I really didn't see many relating to OpenGL...]]></description>
            <content:encoded><![CDATA[<p>Well I have finished my mess around project with OpenGL. I decided to make a screensaver BIG SURPRISE :)! Its fully functioning, with the media embedded (1 image) but it requires the 2 tao DLL's in order to run. Also I went ahead and included the source. Its no big secret how to create a screensaver in C# but I really didn't see many relating to OpenGL. I have my sprite class implemented but not the emitter class, so the program.cs is a bit sloppy because it handles the particles in there.&nbsp; Only thing its missing is multimonitor support, mainly because I forgot to add that until just now. If any one wants me to I can go ahead and add that to the source.</p>
<p>Overall its very simple in nature and I am going to move up now to something a bit more complex, either a screensaver which uses 3d models, or a simple game like breakout or tetris. Decisions Decisions.</p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2009/02/bigbang.zip">Download Screensaver</a></p>
<p><a href="http://www.somethinghitme.com/wp-content/uploads/2009/02/openglplay.zip">Download Source</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Messing around with OpenGL]]></title>
            <link>https://somethinghitme.com/2009/02/23/messing-around-with-opengl/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/02/23/messing-around-with-opengl/</guid>
            <pubDate>Mon, 23 Feb 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Wasn't in the mood this weekend to work on my current flash project, or any other web projects, so I decided to mess around with the TAO framework. I made a game about a year ago called Glow Roids (the name is pretty comical when you think about it) using CsGL. I had a bunch of problems with it on different machines, mostly involving ATI cards, and Vista...]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.somethinghitme.com/wp-content/uploads/2009/02/bigbang1.png"><img src="/2009/02/23/messing-around-with-opengl/images/bigbang1-300x240.webp" alt="" title="bigbang1" /></a>Wasn't in the mood this weekend to work on my current flash project, or&nbsp; any other web projects, so I decided to mess around with the <a href="http://www.taoframework.com/" title="Tao Framework">TAO framework</a>. I made a game about a year ago called Glow Roids (the name is pretty comical when you think about it) using <a href="http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fcsgl.sourceforge.net%2F&ei=GTyiScurK9-BtwfbwMGODQ&usg=AFQjCNFdSA6QNRbAQzkW3XVs6_SbKiPxsQ&sig2=GCRprq-UGCGQ-vyvfMXYww" title="CSGL">CsGL</a>. I had a bunch of problems with it on different machines, mostly involving ATI cards, and Vista. So I decided to try out OpenGL with C# again only this time using the Tao framework. So far it seems to work pretty well on all the machines I've tried it on.</p>
<p>Really all I did was end up converting some of the Nehe lesson 19 code, and then making my own sprite class. Soon I'll make an emitter class so I can have a full featured particle system up and running to eventually make some sort of game. Anyway <a href="http://www.loktar.com/files/bigbang.zip" title="Big Bang">here is</a> the fruits of my labor a crazy particle effect that makes me think of the big bang.</p>
<p>Ill release the source if anyone really wants it. I warn you its not the prettiest!</p>
<p><a href="http://www.loktar.com/files/bigbang.zip" title="Big Bang Zip">Download Zip</a></p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[My Current Flash Project]]></title>
            <link>https://somethinghitme.com/2009/02/15/my-current-flash-project/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/02/15/my-current-flash-project/</guid>
            <pubDate>Mon, 16 Feb 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Nonoba if you haven't heard of this site your missing out. It's a pretty big Flash portal similar to Kongregate, the main difference is they offer a multiplayer API. The API is great, its pretty easy to use, and if you've ever done anything with socket programming and sending messages back and forth you'll find no trouble using it at all.]]></description>
            <content:encoded><![CDATA[<p><a href="http://www.nonoba.com/">Nonoba</a> if you haven't heard of this site your missing out. It's a pretty big Flash portal similar to Kongregate, the main difference is they offer a multiplayer API. The API is great, its pretty easy to use, and if you've ever done anything with socket programming and sending messages back and forth you'll find no trouble using it at all.</p>
<p>I decided to try and incorporate the API into one of my current unfinished projects you can test it out here <a href="http://www.nonoba.com/loktar00/deadendmp" title="Dead End">DeadEnd</a> Right now its not much you and some friends ( up to 8 ) can run around and point your weapon at each other. The cool thing is it only took maybe 3 hours total to incorporate it, and that was just due to my crappy class set up for the player because I never expected to have more than one player in the game. Next step is to add some enemies, and of course the ability to fire weapons. Ill post updates as I finish more of it.</p>
<p>Also I wanted to give credit to <a href="http://www.emanueleferonato.com">Emanuele Feronato</a> if it weren't for his blog I never would of found Nonoba.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Aviary Raven]]></title>
            <link>https://somethinghitme.com/2009/02/11/aviary-raven/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/02/11/aviary-raven/</guid>
            <pubDate>Thu, 12 Feb 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[This site is awesome. I found this a while back when they created Phoenix, basically an online Photoshop. Today I was on Digg and I found an article related to Raven. It's a fantastic application very similar to Adobe Illustrator. The great thing (besides the fact that I can access it anywhere in the world) is that it's totally cross-browser, even]]></description>
            <content:encoded><![CDATA[<p><a href="http://aviary.com/">This site</a> is awesome. I found this a while back when they created <a href="http://aviary.com/dashboard#" title="Phoenix">Phoenix</a> basically an online photoshop. Today I was on Digg and I found an article related to <a href="http://aviary.com/dashboard#" title="Raven">Raven</a> its a fantastic application very similar to Adobe Illustrator. The great thing (besides the fact that I can access it anywhere in the world) is that its totally cross browser even supporting IE6, which unfortunately I am currently married to it at my job….</p>
<p>Anyway if you don't have the $650+ to throw down on any of the Adobe products these products from Aviary are a great alternative, and I will be using them pretty often in the near future.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
        <item>
            <title><![CDATA[Hello everyone.. or just me]]></title>
            <link>https://somethinghitme.com/2009/02/04/hello-world/</link>
            <guid isPermaLink="false">https://somethinghitme.com/2009/02/04/hello-world/</guid>
            <pubDate>Thu, 05 Feb 2009 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello everyone.. or just me: I finally decided to create my own personal blog. I do so many random things throughout the year I figured it's a waste to not share my experiences for anyone who may come across or do something similar. For my first post, I'll share a little about myself. I'm 26 with a wife and 4 kids. By day, I'm a web developer for the government, and by night, I'm a web developer / all-around developer for myself.]]></description>
            <content:encoded><![CDATA[<p>I finally decided to create my own personal blog. I do so many random things throughout the year I figured its a waste to not share my experiences for anyone who may come across or do something similar.</p>
<p>For my first post I'll share a little about myself. I'm 26 with a wife and 4 kids. By day I'm a web developer for the government and by night I'm a web developer / all around developer for myself. I currently run 5 other sites to include,</p>
<ul>
<li><a href="http://www.undeadgames.com">http://www.undeadgames.com</a></li>
<li><a href="http://www.zombiegames.net">http://www.zombiegames.net</a></li>
<li><a href="http://www.zombiebooks.com">http://www.zombiebooks.com</a></li>
<li><a href="http://www.loktar.com">http://www.loktar.com</a> (I sell software I've made here)</li>
<li>Site to be named which has not totally gone public yet.</li>
</ul>
<p>Currently besides this site I'm working on Undeadgames.com its in the redesign stage&nbsp; and I'm hoping to really get that site going well again.</p>
<p>I'm sure mainly what you'll find here are my favorite development topics and random projects i'm working on.</p>]]></content:encoded>
            <author>Jason Brown</author>
        </item>
    </channel>
</rss>