X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.coffee;h=d33d36a7041be52d689144c1d507495819307383;hb=82b65a7f06c06d1561a14a9dfb184dbc4ae08627;hp=e67a3e344626aeab8478042a51a4d91ca5e131bd;hpb=fff36074eecf575408c820f9cbf8a9f2dc6942c5;p=hexbog.git diff --git a/main.coffee b/main.coffee index e67a3e3..d33d36a 100644 --- a/main.coffee +++ b/main.coffee @@ -293,11 +293,6 @@ unselect_all = -> _unselect_tile() update_selection_display() -shrink_selection = (leave_count) -> - while selected.length > leave_count - _unselect_tile() - update_selection_display() - selected_word = -> word = '' word += tiles[i].text for i in selected @@ -335,15 +330,17 @@ blip_selection = -> # convert to arrays so we can sort, etc nneighbors = (v for k, v of nneighbors) neighbors = (v for k, v of neighbors) - # TODO randsort neighbors and nneighbors + # TODO make this apply eavenly to neighbors + # TODO different range for different word lengths for nei in [neighbors, nneighbors] if unsink > 0 for i in nei - if i.hp is 0 and unsink >= 15 + if i.hp is 0 and unsink >= 10 i.new_hp = 10 - unsink -= 15 + unsink -= 10 i.text = new_letter() i.dom.html i.text + for nei in [neighbors, nneighbors] if unsink > 0 for i in nei if i.hp > 0 and unsink > 0 @@ -445,7 +442,7 @@ select_tile = (num) -> new_tile = (num, x, y) -> letter = new_letter() - hp = Math.floor(Math.random() * HP_MAX) + hp = 4 + Math.floor(Math.random() * (HP_MAX - 4)) html_tile = $("