Uncategorized

Friday, September 30th, 2011

This one is very specific, but hopefully useful to someone.

If you’ve ever developed a site using ecommerce platform Magento, you might have discovered that console.log doesn’t work. It seems that some other code has hijacked the function and swallows all the output. This can be hugely frustrating if you are trying to debug some javascript code, but luckily there is a clever way to restore the functionality.

The quick version: Use this code (on document ready) and it will start working again.

window.console = jQuery('<iframe>').hide().appendTo('body')[0].contentWindow.console;

The more detailed explanation of what is happening in the above code:

// create a new iframe
var frame = $('<iframe>');
 
// hide it before adding it to the document so it has no visible effect
frame.hide();
 
// add it, this causes the frame to initialise correctly, and gain it's own window object
frame.appendTo('body');
 
// get the base (non-jQuery) element
frame = frame[0];
 
// get the iframes window object
otherWindow = frame.contentWindow;
 
// replace this windows console with the other windows console
window.console = otherWindow.console;
Saturday, June 25th, 2011

After a long gap I have returned to the world of Javascript game development with a new project, this time an 8bit roguelike (all done with HTML5 canvas).

I’m trying to keep this one simple so I can actually finish it, so it’s very old school, purely tile based, no animation, no physics, which hopefully should enable me to concentrate on the game itself.

At the moment it’s pretty much just a proof of concept, it loads some map data, and you can walk around on it and bump into a few walls and objects.

(more…)

Monday, January 10th, 2011

I’ve just updated the list of company colors (udlr.net/list_of_company_colors), adding a few companies like Facebook and Twitter, and changing the design to fit the new look round here.

Tuesday, January 4th, 2011

Apparently the Kinect works better when mounted above the TV, allowing you to stand up to 30cm closer, ideal in smaller rooms. The only problem is the official Kinect TV Mount is way too expensive (£40!) for what it is (two rods and a platform).

Nonetheless it gave me an idea, the way it used the wall mounting holes (the four screws on the back of most flat screen TV’s used to attach wall mounting brackets) was a good idea, but I was sure I could make something similar for considerably less money. So off I trotted to the shops looking for materials and inspiration.

(more…)

Saturday, November 27th, 2010

New version! Nothing hugely different, i’ve just tweaked a few things to make it more fun. The enemies are smaller, and turn a bit slower to make it feel fairer. Give it a go and let me know what you think in the comments.

Friday, November 26th, 2010

I’ve been having a play around with building games using the HTML5 Canvas element lately, and I thought i’d post what i’ve done so far. It’s nothing special at the moment, just a collection of entities who wander randomly around the screen and kill you if you touch them, but, you know, acorns and oak trees…

Click the preview below to try it out.