Recursion Form

Actionscript:
  1. x = y = 10
  2. graphics.lineStyle(1,0);
  3. drawBox(6);
  4.  
  5. function drawBox(iter:Number=10, count:Number=1, y:Number=0, w:Number=500):void{
  6.        if (count <iter){
  7.                var width:Number = w / count
  8.                for (var i:int = 0; i<count; i++){
  9.                    graphics.drawRect(i * width, width * count/w, width, width);
  10.                }
  11.                count++;
  12.                drawBox(iter, count, y, width);
  13.        }
  14. }

This small snippet just draws this image:

If you have an idea for a short recursive snippet. Feel free to post it in the comments.

Posted in Graphics, functions | Tagged , , | 6 Comments

QuickBox2D Editor 2B Released

I'll be releasing the QuickBox2D on googlecode in the near future based on the response to yesterdays post.

Posted in QuickBox2D | Tagged , , , , | 16 Comments

To release or not to release…

So I have a QuickBox2D editor that I've had since the earliest version of QuickBox2D. It is really pretty buggy and imperfect. I'm wondering if I should release it even though it's really buggy... my main issue is I won't be able to guarantee that it is a safe editor to use for real projects.

Thoughts? Should I release it anyway?

Posted in QuickBox2D | Tagged , | 13 Comments

AS Quiz #18

Today's quiz is about BitmapData and the Graphics class...

Number of Questions : 5
Difficulty : Medium
Topic : BitmapData, Graphics

True or False. Subpixel x and y coordinates for DisplayObjects are made possible by anti-aliasing.



Which of the following methods would you use to set a pixel with an alpha channel value?





Which of the following methods would you used if you wanted to boost performance when drawing to a BitmapData object?




True or False. Perlin Noise is built right into the BitmapData class.



Which of the following methods does not exist in the Graphics class?











Posted in Quiz | Tagged , , , | 8 Comments