+unsink = (tile) ->
+ tile.new_hp = 10
+ tile.text = new_letter().letter
+ tile.dom.html tile.text
+
+
+# top-level key is word length
+# arrays are [difficulty] level, easiest to hardest
+booms = {
+ 3: {
+ neighbors: {
+ flips: [1,1,1,1,0]
+ force: [2,2,1,1,1,1,0]
+ }
+ neighbor_neighbors: {
+ flips: [0]
+ force: [0]
+ }
+ board: {
+ flips: [0]
+ force: [0]
+ }
+ }
+ 4: {
+ neighbors: {
+ flips: ['all', 4,4,4,4,4,3,3,2,2,1]
+ force: [4,3,3,3,3,3,2]
+ }
+ neighbor_neighbors: {
+ flips: [0]
+ force: [2,2,2,1,1,1,0]
+ }
+ board: {
+ flips: [0]
+ force: [0]
+ }
+ }
+ 5: {
+ neighbors: {
+ flips: ['all','all','all','all',5,5,5,4,4,4,3,3,3,2]
+ force: [6,6,6,6,5,5,5,4,4,4,3]
+ }
+ neighbor_neighbors: {
+ flips: [2,2,2,2,2,2,1,1,1,1,0]
+ force: [4,3,3,3,3,2,2,2,1]
+ }
+ board: {
+ flips: [0]
+ force: [0]
+ }
+ }
+ 6: {
+ neighbors: {
+ flips: ['all','all','all','all','all',9,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4]
+ force: [9,9,9,9,9,8,8,8,7]
+ }
+ neighbor_neighbors: {
+ flips: [5,5,5,5,5,5,5,4,4,4,3,3,3,2,2,2,1]
+ force: [6,6,5,5,4,4,3,3,2]
+ }
+ board: {
+ flips: [0]
+ force: [0]
+ }
+ }
+ 7: {
+ neighbors: {
+ flips: ['all']
+ force: [10]
+ }
+ neighbor_neighbors: {
+ flips: ['all','all','all','all',9,8,7,6,5,4,3,2]
+ force: [10]
+ }
+ board: {
+ flips: [0]
+ force: [5,4,3,2,1]
+ }
+ }
+ lots: {
+ neighbors: {
+ flips: [0]
+ force: [0]
+ }
+ neighbor_neighbors: {
+ flips: [0]
+ force: [0]
+ }
+ board: {
+ flips: ['all']
+ force: [10]
+ }
+ }
+}
+difficulty_level = 0
+next_level_at = 200
+adjust_difficulty_level = ->
+ while score > next_level_at
+ difficulty_level += 1
+ next_level_at *= 1.4
+
+
+# remove the selected tiles from the board, create new tiles, and slide everything into place