       inventoryHotbar.refresh()
       console.log 'survival mode'
 
+  # the GUI window (built-in toggle with 'H')
+  # TODO: should these load as plugins? or not? who 'owns' the datgui object?
   gui = new datgui.GUI()
-  console.log 'gui',gui
-  debug = plugins.load 'debug', {gui: gui}
+  debug = createDebugUI game, {gui:gui}
   debug.axis [0, 0, 0], 10
-
   pluginsUI = createPluginsUI game, {gui: gui}
   bindingsUI = createBindingsUI game, {gui: gui, kb: game.buttons}
 


createGame = require 'voxel-engine'
createPlugins = require 'voxel-plugins'
createPluginsUI = require 'voxel-plugins-ui'
createBindingsUI = require 'kb-bindings-ui'


  #playerInventory.give new ItemPile('workbench', 1)
  #toolbar = createToolbar {el: '#tools'}
  #inventoryToolbar = plugins.load 'inventory-toolbar', {toolbar:toolbar, inventory:playerInventory, inventorySize:10, registry:registry}
  plugins.preload 'inventory-hotbar', {inventory:playerInventory, inventorySize:10}

  plugins.preload 'inventory-dialog', {playerInventory:playerInventory}

