     event.preventDefault()
     return false
 
+  reach.on 'place', (adjacent) ->
+    game.createBlock adjacent, game.currentMaterial
+
+  mine.on 'break', (goner) ->
+    #console.log "exploding",goner
+    #game.explode goner # TODO: update voxel-debris for latest voxel-engine, doesn't pass materials?
+    game.setBlock goner, 0
+
   # block interaction: left/right-click to break/place blocks, uses raytracing
   game.currentMaterial = 1
-
-  game.on 'place', (adjacent) ->
-    game.createBlock adjacent, game.currentMaterial
 
   game.explode = debris(game, {power: 1.5})
   game.explode.on 'collect', (item) ->
     console.log("collect", item)
-
-  game.on 'break', (goner) ->
-    #console.log "exploding",goner
-    #game.explode goner # TODO: update voxel-debris for latest voxel-engine, doesn't pass materials?
-    game.setBlock goner, 0
 
   game.on 'tick', () ->
     walk.render target.playerSkin

extend = require 'extend'
fly = require 'voxel-fly'
walk = require 'voxel-walk'
mine = require 'voxel-mine'
reach = require 'voxel-reach'
debris = require 'voxel-debris'
createDebug = require 'voxel-debug'


  game.flyer = makeFly target
  game.flyer.enabled = false

  reach = createReach(game)
  mine = createMine(game, {instaMine: false, reach: reach})

  console.log "configuring highlight "
  # highlight blocks when you look at them, hold <Ctrl> for block placement
