top | item 7268079

Show HN: ThreesJS – iOS game Threes for the browser

81 points| angelaconstance | 12 years ago |threes.meteor.com

37 comments

order
[+] madsushi|12 years ago|reply
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.
[+] silvertab|12 years ago|reply
Agreed. It seems like such a small detail, and yet, playing this web version, I realize how much I depend on it!
[+] Encosia|12 years ago|reply
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.

[+] angelaconstance|12 years ago|reply
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.)

[+] damon_c|12 years ago|reply
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.

*edit Someone figured it out here: http://bitsplitting.org/2014/02/11/threes-scoring/

[+] prezjordan|12 years ago|reply
Article isn't loading for me, but each (3+) tile can be represented as 3 * 2^k, and it's score is calculated as 3^(k+1)

    3   -> 3 * 2^0 -> 3^1 -> 3 pts
    6   -> 3 * 2^1 -> 3^2 -> 9 pts
    192 -> 3 * 2^6 -> 3^7 -> 2,187 pts
I may have an off-by-one (degree) error though. It helps to be a big math geek who looks for exponents everywhere.
[+] hayksaakian|12 years ago|reply
No touch control makes me sad.

Should call it Threes for PCs.

[+] angelaconstance|12 years ago|reply
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!
[+] nacs|12 years ago|reply
Nicely implemented.

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?

[+] davepeck|12 years ago|reply
This is excellent!

Out of curiosity, what distribution of "next" tiles is produced?

[+] angelaconstance|12 years ago|reply
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.

[+] podperson|12 years ago|reply
Good job.

The simple alert at the end for the score is a bit of a weakness.

I agree about the partial slide movement testing. Perhaps hit the arrow to test the move and double-tap it to actually make the move.

[+] andyhmltn|12 years ago|reply
This is awesome! I'm looking to do something similar and add new features as a learning project. Any pointers on what you used or is it pure JS?
[+] jbeja|12 years ago|reply
It used meteor.js
[+] kevinflo|12 years ago|reply
Record so far is 7202. I kind of get the feeling that if you get the pattern down you could go almost infinitely... is that impression correct?
[+] saltylicorice|12 years ago|reply
This is wonderful. Adding the soundtrack was a nice touch.
[+] glifchits|12 years ago|reply
Love how it is way faster than the iOS version on my 4S.
[+] evan_|12 years ago|reply
How are you playing on an iOS device? Bluetooth keyboard?
[+] zamalek|12 years ago|reply
Awesome stuff! What's considered a passable score?
[+] andrewfelix|12 years ago|reply
Very nice.

Confusing name, I immediately though you were using three.js

[+] Davertron|12 years ago|reply
You got the color of the ones and twos swapped :p

Great job!