• Adding Extension Methods to PHP

    If you've ever used the .NET Framework version 3.5 of later, you'll probably have encountered extension methods. Microsoft describes extension methods as:

    Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type.

    In this article, I will show you how to write a base class that will allow you to add methods to any PHP class that inherits from it at runtime. You will be able to call these methods transparently, without any special syntax.

    Read more (6 comments)

  • How to do an AJAX search with jQTouch, Part 1

    jQTouch is a pretty nifty little jQuery plugin for making websites look like native iPhone apps. Unfortunately, beyond a bunch of examples included with the distribution, there's not a whole lot of online documentation written for jQTouch. Having started to use jQTouch for a professional project, I thought I'd help remedy this deficiency by posting what I learned along the way.

    We'll start with something fairly straightforward by making a jQTouch app that makes an AJAX call to a PHP script to search a database. It then displays the results of that search in the jQTouch app. This article is split up into two parts. The first part deals with the jQTouch UI and the second part deals with the PHP script and the supporting JavaScript.

    This is part 1 of a two part series.

    Read more (12 comments)

  • Anders Hejlsberg talks about C# 4.0

    Channel 9 has posted a great talk by Anders Hejlsberg, the original author of Turbo Pascal, the chief architect of Delphi, and the lead architect of C#.

    History lesson: Anders was lured away from Borland by Microsoft with a hefty offer of a $1.5 million signing bonus, a base salary of up to $200,000, and options to buy 75,000 shares of Microsoft stock.

    Looks like it was worth it, as each C# release has added many interesting and powerful features, while maintaining a fine balance between complexity and simplicity.

    Read more (1 comment)

  • Trimming in ActionScript jQuery-style

    Sometimes we want to remove whitespace from the ends of our strings. In fact, this task is so common on the web that the ubiquitous jQuery library includes a utility method for that purpose.

    What about in ActionScript 3? Well, not so much. The String class in AS3 is, in my opinion, a bit lacking compared to languages like C# and Scala. What's worse, you can't augment prototypes easily like you can in JavaScript to add missing methods (see update at the end for more information on this).

    Read more (1 comment)

  • SpriteFactory, an AS3 library for creating multiple sprites using the same bitmap

    While working on Flash sidescroller stuff I noticed that there was no easy way (that I could find) to create multiple sprites from a single bitmap (something you'd do when doing a tile-based graphics layout).

    Sooo... I made my own simple library called SpriteFactory.

    Here's some example usage:

    var factory:SpriteFactory = new SpriteFactory("assets/sprites");
    factory.loadBitmap("grass", "block-grass.png");
    var grass1:Sprite = factory.newSprite("grass");
    var grass2:Sprite = factory.newSprite("grass");

    Check out the project page for more information.

    Read more

  • YouTube Basic Sidescroller Tutorial in FlashDevelop

    As I've made up my mind to learn Flash, and don't want to pay a honkin' amount of cash, I decided to go with a free Flash IDE called FlashDevelop.

    Since I'm toying around with the idea of sidescrollers, I did a search for "Flash sidescroller tutorial" and found this excellent 3-parter by devnote.org.  Unfortunately (for me), the tutorial expects that you're using Adobe's Flash IDE.  Thus, as a contribution to the web (and myself... mostly myself), I translated the tutorial to work with FlashDevelop.  Read on to see how I did it, or just grab the source here.

    Read more

  • Wezzle price drop

    As some of you may know, I'm a co-founder of the indie games company Couchware Inc. About a month ago, we released Wezzle, our first title. A few days ago we released a free web version of the game called Wezzle for Web (which you should try out! :)).

    As if there wasn't already enough Wezzle awesomeness going around, we just reduced the price of the game to $4.99 (from $14.99). So, if you haven't yet grabbed a copy of Wezzle, I highly recommend you do it now.

    For those of you unfamiliar with Wezzle, it's a casual puzzler that features four unique items, 3 difficulty modes, 10 original songs and eye-poppingly colourful graphics.

    Read more

  • The jQuery animate() step callback function

    If you've ever needed to do more complex animations than fades and slides, then you've probably encountered the jQuery animate function. The animate function allows you quite a bit more flexibility than just using fadeOut or slideDown. In fact, the oft-used fades and slides simply wrap calls to animate.

    If you've ever looked at the jQuery animate docs at api.jquery.com you might have noticed that one of the optional arguments you can define is step which is defined as:

    A function to be called after each step of the animation.

    ...and that's it. If you search for "step" on the page, you won't see another mention of it.

    Read more (8 comments)

  • What I Liked About Final Fantasy

    Final Fantasy, a.k.a. FF1, is an NES RPG first published in Japan in 1987 and then in North America 3 years later.  I remember when I first played it as a kid at my friend Dave's house.  It blew my mind.  I would dream about Fighters and Red Mages and making the orbs shine again.

    Final Fantasy 1 BattleRecently, FF1 was released on the Wii Virtual Console and, even though I already owned it on my NES, I felt the urge to play the classic again without the fear of my NES crashing because I blinked too hard.

    So I flipped on my Wii, downloaded the game, and played it for about 2-3 hours a night for a week (keep in mind I logged many, many hours playing this game as a child).  Here are my thoughts on the title.

    Read more

  • Fep Section

    I just added a new Fep section. I'm going to try to work on a bit more (just ordered this sucker) as making a programming language has been something I've always had an interest in.

    First stop: parsers!

    Read more

subscribe via RSS