Author Archives: Bhaldie

Good Site for iPhone and Flash Knowledge

Just wanted to give a link to a website I stumbled upon the other day:Cocos2d

http://www.bit-101.com/blog/

Very interesting stuff especially the use of an iPhone 2d game sdk called Cocos2d which can be found here:

http://code.google.com/p/cocos2d-iphone/

Definitely will be a help when it comes to iPhone development!!

Thats all for now 😉

Actionscript 3 Animated Bitmap Part I

I’ve been working on games for awhile now, and I was looking for a way to make the process of taking art assets and bringing them into flash a little easier.  So my quest started where every quest should start now a days the interwebs!!

What I found was just what I was looking for, a web site called hexagonalstar.com had the info I needed to start creating my own Animated Bitmap class.  So I downloaded there source code and started to work.

I must say that without this source code I would have been stuck, it was very helpful and I just wanted to thank them for all their hard work.

Anyway lets get on to what my plans are.  First, I am slowly created a Flash API code name Memphis, which is a library to help me improve the development time of flash games.  So the animated bitmap class will be added to Memphis as another feature.

What I have right now is pretty simple, just the barebones of the class started.  I can take a bitmap from the library and create the animated bitmap from that image.  What I am planning is to have the ability to start and stop the animated bitmap on command and some other coolio stuff.

Below is my function to create the simple animated bitmap:

[code lang=”actionscript”]
var ab1:Sprite = MemphisAPI.AnimateBitmap({ image:ring_seq, width:32, height:32, columns:21,framerate:30});
[/code]

Which is then passed to Memphis which handles the process:

[code lang=”actionscript”]
public static function AnimateBitmap(Properties:Object):Sprite {
var sprite:Sprite = new Sprite();
var column:Number = 0;
var xPos:Number = 0;
var yPos:Number = 0;
var origData:BitmapData = BitmapData(new Properties.image(0,0));
var newData:BitmapData = new BitmapData(Properties.width,Properties.height,true,0x000000);
var animatedBitmap:Bitmap = new Bitmap(newData);

var timer:Timer = new Timer(Properties.framerate);
timer.addEventListener(TimerEvent.TIMER, timerFunc);
timer.start();

function timerFunc(e:TimerEvent) {
var _point:Point = new Point(0, 0);
var _rect:Rectangle = new Rectangle(xPos, yPos, 32, 32);
newData.copyPixels(origData, _rect, _point);
xPos += Properties.width;
sprite.addChild(animatedBitmap);
if(column > Properties.columns) {
xPos = 0;
column = 0;
}
column++;
}
return sprite
}
[/code]

So as you can see this is a very basic function right now, but hopefully if everything goes well I will have a fully working animated bitmap class.

Once again I want to thank the website hexagonalstar for pointing me in the right direction 🙂

Piggeez Now on the iPhone

3D Reflex is proud to announce the release of Piggeez for the iPhone.

Bank as many coins as you can in this race against the clock. Raise your earnings by banking multiple coins at once, but don’t get too greedy, or you’ll get locked out of the safe!

Move the coloured coins so they are above the appropriately coloured piggy banks. To rearrange any two coins, simply touch them one at a time. To bank the coins, you will need to touch the piggy banks below, but remember, you will need at least 2 of the same colour at the bottom of the row. The higher you stack the columns, the more money you will make when you bank. Don’t get too greedy or you will run out of room. If one of your columns is getting too high, use a hammer to smash the piggy bank and clear the entire column. To use a hammer, simply touch the hammer icon followed by the piggy bank you would like to smash.