PixelBlitz Update – addLimit() and removeLimit()

While chatting to Norm on MSN we were both quite surprised at the lack of Game specific libraries / frameworks for AS3. Things that make creating a game as easy as possible for the developer. That is what we really want PixelBlitz to turn into, and I made another small step towards it today.

I’ve commited r22 to Google Code, which contains two new commands: addLimit() and removeLimit(). They are as easy to use as this:

[as]
//    The Player
player = new PixelSprite(new Bitmap(new plane1BD(0, 0)));

//    Limit the player to the region starting from 100,100 down to 450,300
player.addLimit(100, 100, 450, 300);
[/as]

Essentially all it does is limit the PixelSprite to a set region of the stage (in this case a 350×200 block in the middle). It’s far from earth shattering, but PixelBlitz is about helping you make your game quickly, with as clean code as possible, and all these little things build up over time.

It means that when checking the keyboard to see if you can move the player, you no longer also need to check the X/Y position, because that is being handled for you.

I’d post a demo, but I figure you can work out what it looks like already :)

Posted on August 31st 2008 at 1:52 pm by .
View more posts in PixelBlitz. Follow responses via the RSS 2.0 feed.


One Response

Leave a comment

Make yourself heard