1/2
1/2
13
13
November 30, 2008at7:19 pm AS3.0, English, Experimentals, flash, 3 Comments
55
55
377
377

(o) 300×300 (o)
LebenZwei 300x300

(o) 500×500 (o)
LebenZwei 500x500

(o) 1000×1000 (o)
LebenZwei 1000x1000

You need latest flash player to view these. (installation)

It might start automatic or not. If not try to click on it. If still nothing special happens try to click on it few times in a row. After this all you see on the screen is reactions. It does what ever the Change allows. In some cases it might run forever.
Fullscreen, as always, is set on by clicking any key.

I think there’s more to come with this game of life code.

21
21

What do you think of this? (3)

1/2
1/2
13
13
November 30, 2008at2:04 pm AS3.0, English, Experimentals, flash, 3 Comments
55
55
377
377

Life
You need latest flash player to view this. (installation)

(o) Life 900×480 (o)
(o) Life 640×420 (o)
(o) Life 400×300 (o)
(o) Life 200×200 (o)
(o) Life 200×1000 (o)
(o) Life 1000×300 (o)

Before you press them grab my thoughts.
There are pixels on a screen. Let’s call one of them Frank. Every items like Frank has a birth knowledge of their neighbors both vertical and horizontal. On every 0.5 seconds fortune moves one of them into random direction.

Suddenly something moves Frank. He panics and urge his neighbors to move also. Because they have been Franks neighbors for some time they trust Frank and copy the panic to their neighbors. Some of the neighbors are skeptical and hardly move at all and won’t pass some others concerns to neighbors. Sometimes when everybody is yelling “move, move, move!” even the most doubtful cannot resist of joining the viral. Happens every day in every size.

This madness forms beautiful patterns with extremely high complexity.

View them in fullscreen mode. Click on flash and then any key.

—–
Different, but in same area and the most famous of all Conway’s game of life.

21
21

What do you think of this? (3)

1/2
1/2
13
13
November 28, 2008at2:45 pm English, Olipa kerran, web, No Comment
55
55
377
377

… well just wanted to announce that I will probably continue to do so for next decade also. Since it’s the only thing I can do properly.

p.s. There’s still some hours left to participate on 25 lines of actionscript contest at www.25lines.com. :)

21
21

What do you think of this?

1/2
1/2
13
13
November 12, 2008at5:50 pm AS3.0, design patterns, English, flash, 2 Comments
55
55
377
377

I hate this pattern and it’s very popular these days with as3 API’s:

package
{
        public class AllMightyClass
        {
                public var _value0:String;
                public var _value1:Array;
                public var _value2:int;
                public var _value3:Object;
               
                public function AllMightyClass(params:Object)
                {
                        _value0 = params.value0;
                        _value1 = params.value1;
                        _value2 = params.value2;
                        _value3 = params.value3;
                }

        }
}
// FROM OUTSIDE THIS WOULD LOOK LIKE:
var amclass:AllMightyClass = new AllMightyClass(
//editor hints: AllMightyClass(params:Object)

Is this something that people use with some other language or something they learn at school?
It’s just wrong. The end user has no idea what params it wants or what’s their type.

Why not use:

package
{
        public class Test
        {
                public var value0:String;
                public var value1:Array;
                public var value2:int;
                public var value3:Object;
               
                public function Test(value0:String, value1:Array, value2:int, value3:Object)
                {
                        this.value0 = value0;
                        this.value1 = value1;
                        this.value2 = value2;
                        this.value3 = value3;
                }
        }
}
// FROM OUTSIDE THIS WOULD LOOK LIKE:
var amclass:AllMightyClass = new AllMightyClass(
//editor hints: AllMightyClass(value0:String, value1:Array, value2:int, value3:Object)

You may still pass stuff to baseclass in object-format if you like and you may still check if some values are null and then turn them into default. With the first pattern API’s user need to open the class to see what parameters it swallows or even worse browse the documentation.

But there is even better way to do this:

// FIRST CREATE A VALUEOBJECT CLASS
package
{
        public class AllMightyClassVO
        {
                public var value0:String;
                public var value1:Array;
                public var value2:int;
                public var value3:Object;
                public function AllMightyClassVO(value0:String, value1:Array, value2:int, value3:Object)
                {
                        this.value0 = value0;
                        this.value1 = value1;
                        this.value2 = value2;
                        this.value3 = value3;
                }
        }
}

// USE THAT TO PASS YOUR PARAMETERS
package
{
        public class AllMightyClass
        {
                public var value0:String;
                public var value1:Array;
                public var value2:int;
                public var value3:Object;
               
                public function AllMightyClass(valueObject:AllMightyClassVO)
                {
                        this.value0 = valueObject.value0;
                        this.value1 = valueObject.value1;
                        this.value2 = valueObject.value2;
                        this.value3 = valueObject.value3;
                }
        }
}
// FROM OUTSIDE THIS WOULD LOOK LIKE:
var amclass:AllMightyClass = new AllMightyClass(
//editor hints: AllMightyClass(valueObject:AllMightyClassVO)
// OK IT EATS AN OBJECT CALLED AllMightyClassVO (let’s write some more)
var amclass:AllMightyClass = new AllMightyClass(new AllMightyClassVO(
//editor hints: AllMightyClassVO(value0:String, value1:Array, value2:int, value3:Object)

You can allways extend your VO class with some abstract when you want to pass it down to base classes. This way you make it look intuitive for end user.

21
21

What do you think of this? (2)