Somethinghitme

Code, demos and ideas.

Deep copying in JavaScript

Posted April 27, 2022

Deep copying / cloning in JavaScript

tldr; structuredClone

Copying by value or reference

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…

Continue Reading

Floating text from cursor generative demo

Posted March 31, 2022

Came across this tweet 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.

Continue Reading

Simple One Element Toggle

Posted October 23, 2021

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?

The main purpose was to allow it to be used as a checkbox with a…

Continue Reading

Simple 2d Terrain With Midpoint Displacement

Posted November 12, 2013

Codepen terrain

Screenshot from scrolling terrain and shooting stars demo on codepen.io

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…

Continue Reading

Burn Away Effect Explanation

Posted November 07, 2013

This explanation doesn’t show any code more of just an overview of how to achieve a simple but cool looking effect.

I’ve seen variations this effect used in different places, one of the more recent examples I can think of is the loading…

Continue Reading

Working on a new JS game

Posted October 10, 2013

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.

The name of the…

Continue Reading

3d Shading with Points

Posted August 17, 2013

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…

Continue Reading

Rainbow bright bookmarklet

Posted January 03, 2013

Went a little crazy with a friend of mines bookmarklet he made that would randomly change the colors of all elements on a page.

Gist

Just drag this link to your bookmarks and click it on any random page to enjoy the show

[Rainbow Bright Bookmarklet](javascript:function c(){return Math.floor(255Math.random())}function g(){var a=parseFloat(this.dataset.d);isNaN(a)&&(a=~~(100Math.random()));with(this.style){var d=/rgb((\d{1,3}), (\d{1,3}), (\d{1,3}))…

Continue Reading

HTML5 Canvas Flood Fill

Posted March 07, 2012

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 decied to tackle the flood fill portion which is a major part of the gameplay.

Here is the workhorse…

Continue Reading

Glow Roids

Posted February 07, 2012

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…

Continue Reading

Meat Boy Pumpkin!

Posted October 31, 2011

Starting messing around with grinding out a pumpkin rather than cut, this is my first attempt. I love Super Meat Boy so I tried to capture his awesome little face! I definitely need to practice the rest of the year on apples or something.

Continue Reading

Gaming Gaming Gaming

Posted October 30, 2011

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…

Continue Reading

My entry for js1k #3

Posted April 24, 2011

Below is what I ended up settling on for an entry for the JS1k. My ideas ranged for a rainbow road (similar to the Mario Kart level), to a 3d tombstone that said dysentary, a terrain generator, then a wave generator. I ended up just…

Continue Reading

CSS3 Animations are Fun!

Posted March 14, 2011

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…

Continue Reading

JS1k XMAS submission

Posted December 09, 2010

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…

Continue Reading

Got a kindle

Posted September 28, 2010

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…

Continue Reading

A New look

Posted September 27, 2010

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…

Continue Reading

JSLander completed

Posted July 04, 2010

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…

Continue Reading

DSx86 is awesome!

Posted June 08, 2010

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…

Continue Reading

JavaScript Canvas Lightning Effect

Posted May 25, 2010

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…

Continue Reading

How to get the week in a month for a date with Javascript

Posted April 14, 2010

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

[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…

Continue Reading

Javascript Sorting by date time

Posted April 12, 2010

Im 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…

Continue Reading

New Canvas game im working on

Posted February 02, 2010

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…

Continue Reading

OpenGL Screensaver

Posted February 25, 2009

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…

Continue Reading

Hello everyone.. or just me

Posted February 05, 2009

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 similiar.

For my first post I’ll share a…

Continue Reading