       set_shape(sprite_dict, shapes)
       child = world.add_child sprite_dict
       child.handle_event 'apply'
-      # world.send 'inspect', child
+      child.handle_event 'prepare'
+      world.send 'inspect', child
   inspect: (world, sprite) -> world.put 'inspected', sprite
   selected: (world) -> world == world.get('inspected')
 


{my} = require '../my'
{vector} = require('../god/vector')

transform = (world) ->
  center = world.get('cell_size') / 2

    rotate = "rotate(#{world.get('angle')} #{center} #{center})"
    "#{translate} #{rotate}"

  running: (world, args) ->
    'repeat'

  name_style: (world) ->
    cell_size = world.get 'cell_size'
    {x: 0.5 * cell_size, y: 0.5 * cell_size, fill: "white", stroke: "white"}

  prepare: (world, args) ->
    word = world.get('language')[args]
    console.log args
    # TODO: use language.coffee
    # this is bad. it should be getting this from language.coffee
    signal = word.split " "
    signal[2] = parseInt signal[2]
    world.call 'perform', signal

  perform: (world, action) ->
    [method, key, value] = action
    my.assert world[method], "#{world.label()}: no '#{method}' property"
    world[method](key, value)

  #propose: (world, proposal) ->
    #others = world.send 'at_position', proposal
    #results = others.map (other) -> other.call 'bumps', world
    #world.put 'position', proposal unless results

  go: (world, dir) ->
    cell_count = world.get_plain('cell_count')
    my.assert dir?, "expects dir"
    sum = get_location_for_move world, dir
    world.send 'propose', [world, sum]
    #if vector.inside(sum, cell_count)
      #world.call 'propose', sum
    #else
      #world.send 'error', "#{world} attempted to move out of bounds"

  turn: (world, dir) ->
    my.assert dir?, "expects dir"
    world.put 'direction', vector.turn(world.get_plain('direction'), dir)
    true # always a valid move

  apply: (world, args) ->
    {target, action} = args
#    console.log "apply world #{world}, target #{target}"
    world.call('perform', action) if world == target

  step: (world, args) ->
    local = world.get('programs')
    return unless world.is_world local
