PixelBlitz Update - addLimit() and removeLimit()
Sunday, August 31st, 2008
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:
-
// 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);
Essentially all it does is limit the PixelSprite to a set region of the stage (in this case a 350x200 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 ![]()




The post title says it all really! If like me your AS3 coding life depends on FlashDevelop, then do yourself a favour and grab the new 
