This feels just like the real game. I am just missing the predictive/"test" move that lets you see what would happen without actually moving the tiles.
I think the game mechanics are off slightly, compared to the iOS app.
I had this layout (with some other unrelated tiles):
- - - -
- - - -
1 - - -
2 - - -
And, pressed down to combine the 1 and 2, but it wouldn't let me until the column was full of tiles to "push" them together. In the iOS app, swiping down at that point would have combined the 1 and 2 into a 3 at the bottom-left position.
I hate to nitpick though. Great job overall.
edit: Strange. I just tried again and can't reproduce that behavior now.
Think I know what's happening here! My way of preventing too many keystrokes in quick succession is pretty hacky—basically, if you keypress <300ms after your last physical keypress, it doesn't fire an event. More appropriate would be to only suppress the event if it's <300ms after the last keypress that actually fired an event (vs all keypresses). Will fix ... :P
(The game mechanics should be identical to the iOS app though, with the exception of the occasional high-number tiles provided. Also in my todo list to figure out the algorithm the game uses to generate them, haha.)
You must have figured out how they score the different numbers. 96 is like 780 points, 192 gets 3500, 384 gets around 6200 points, 768 gets 22000 or so... Did you find an obvious pattern? I was curious about this but too busy enjoying the game to think about it.
Purposely made it nonfunctional (or mostly nonfunctional) on mobile devices, to not step on the toes of the original creators—they're coming out with an Android version soon!
I found it interesting that you used Meteor to build this game -- I initially thought it was a fully client-side Javascript only canvas-based game. Is there any reason for using it considering this app doesn't appear to be using any backend?
Grabbed the strategy from this article (http://www.kotaku.com.au/2014/02/tips-for-playing-threes-the...)! Basically there is a deck of 12 cards (four 1's, four 2's, four 3's) that is shuffled, drawn from, and reshuffled when the deck is empty. Originally I just had it populate randomly from the same distribution, but it resulted in a startlingly high frequency of terrible boards with like 10 red tiles floating around and no blues.
As mentioned in an earlier comment and in the article, the actual iOS game also inserts higher-number cards (6, 12, 24, ...) into the stack occasionally, though I haven't added that element to this version yet.
That's a good pointer, thanks. I've been thinking about building a simulator to help qualify Threes strategies.
In more advanced games, higher-number "next" cards are somewhat critical. When you do add them, I'd love to hear how you did it!
I believe the higher numbers work like this: every 21 turns, Threes generates a number from 0-20. After this number of turns elapses, if the highest number seen is 48 or greater, Threes skips drawing from the normal set of ones, twos, and threes, and instead generates a "special spawn". The special spawn is a number between 6 and <highest number seen> / 8 (I believe the distribution is uniform).
Source: Threes writes a preference plist that allows it to resume games if the app is killed in the background. The keys to look at are "PseudoSpawnSpecialIndex" and "PseudoSpawnSpecialList".
Funny, I've been doing the same thing. The hardest (well, most tedious) part has been figuring out the exact distributions used for the various random parameters.