This applet is based on Ken Perlin'sTwo Actors pollys applet.
The Polly source was modified to be able to handle blocks.
You can find the modified sources here : Polly.java, PollyWalls.java and a new class describing the block they carry : Block.java.
The blocks can actually have multiple parameters which make them attractive to pollys. Pollys can be then programmed to like or not like certain parameter. For now, its hard coded.