Flash Russia Bricks (as3)

[ 2009-04-23 14:16:21 | Author: liuhuan ]
Font Size: Large | Medium | Small
Russia Bricks is a classic game everybody has played before. I tried to make one in as3.



Here i used a classic way to describe the bricks in array:
Quote
var arr_brickTypes:Array = new Array()
arr_brickTypes.push([[1,1,1,1]])
arr_brickTypes.push([[1,0,0,0],[1,1,1,1]])
arr_brickTypes.push([[0,0,0,1],[1,1,1,1]])
arr_brickTypes.push([[1,1,0],[0,1,1]])
arr_brickTypes.push([[0,1,1],[1,1,0]])
arr_brickTypes.push([[1,1],[1,1]])
arr_brickTypes.push([[0,1,0],[1,1,1]])
It's very convinient to detect the hit between bricks using getPixel. Remember the value to get pixel from a transparent point and a white point is different.

If you are interested, you can also download the as3 source file here:

Click Here To Download
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=969

There is no comment on this article.

You can't post comment on this article.