class ShieldFactory : AbstractRole { override fun begin() { val across = 8 val down = 4 for ( x in 0 until across ) { for ( y in 0 until down ) { var name = "shield" if ( y == 0 ) { if ( x == 0 ) name = "shieldNW" if ( x == across - 1 ) name = "shieldNE" } val shieldA = actor.createChild( name ) shieldA.direction.radians = actor.direction.radians shieldA.moveForwards( (x - across / 2) * 10 ) shieldA.moveSidewards( (y - down / 2) * 10 ) } } actor.die() } override fun tick() { } }