Friday, May 7th, 2010
Continuing from last week, where I introduced a simple but powerful Dojo MVC solution, let's look at how to put it together into a simple but useful application "framework".
Posted in Programming | 3 Comments »
Tuesday, April 27th, 2010
More complex JavaScript applications benefit from the MVC pattern just like other sorts of applications. Just like for other sorts of applications, there are dedicated MVC libraries for JavaScript, such as JavaScriptMVC.
Dojo, in my opinion one of the most powerful and flexible JS libraries, can be easily adapted to ...
Posted in Programming | 4 Comments »
Friday, February 12th, 2010
Here's a question I was pondering a couple of days ago: Can you make JavaScript's String object mutable, as in modifiable without having to re-assign the string.
Why would this be useful? Sometimes you might share a string between objects, and you'd want changing it in one place get reflected in ...
Posted in Programming | 2 Comments »
Thursday, January 7th, 2010
As I've been rewriting TankWar, I've been thinking of various approaches to displaying the game's graphics. At the moment, I can count three feasible approaches for rendering game graphics:
DHTML - In other words, using divs with images and moving them around
Canvas
A hybrid: Canvas with DHTML
I've considered each of these, and ...
Posted in general | 4 Comments »
Wednesday, December 16th, 2009
I have decided to rewrite TankWar, and I'll be writing a bunch of blog posts about the process. If you ever wanted to know how to write a scorched earth/worms-like game using just JavaScript, now is your chance to learn ;)
This is the first one: Assessing the damage. In other ...
Posted in Programming | 3 Comments »
Wednesday, December 2nd, 2009
You may recall an earlier post about TankWar, my 100% JavaScript cannons-game. Back when I wrote it, I included online play, but the server went down with a hard disk failure.
Now, I have rewritten the online mode - this time that part is also all JavaScript - continue reading to ...
Posted in Web | 5 Comments »
Friday, November 27th, 2009
Hey it's Friday so it's time to try a fun JavaScript hack - Let's go and precompile some functions!
What does "precompiling" mean? In principle, it means we take a function which takes multiple parameters and pre-define some of them. All this is done dynamically, so your code can do it ...
Posted in Programming | 1 Comment »
Friday, August 21st, 2009
Have you ever thought about writing a game? If you have, you've probably wondered how to render animations for your game characters. In this post, I'll show you how you can use JavaScript to do time-based sprite animations, drawing them on canvas - vital if you want to do a ...
Posted in Programming | 5 Comments »
Tuesday, August 4th, 2009
I've recently been looking into some JavaScript unit testing frameworks. There are many alternatives, and while many of them seem good, very few of them actually matched my requirements:
Must be able to run tests from the commend-line
Tests should be relatively easy to write
Posted in Programming | 7 Comments »
Saturday, August 1st, 2009
Have you ever filled a textarea on a page, which had a limit to how many characters you could type into it? Or maybe you are a Twitter user, and as you know, Twitter only displays 140 characters of your tweets.
(Not an actual textarea) The other day I was thinking ...
Posted in Programming | 1 Comment »