|
![](/i/fill.gif) |
> http://en.wikipedia.org/wiki/2048_(video_game)
It's open source, so I can answer my own question, the value of the new
tile that is randomly generated is chosen thus:
var value = Math.random() < 0.9 ? 2 : 4;
So it's a 90% chance of a 2, 10% chance of a 4. Interesting.
> Looks very good - nice work!
> I'd be interested to see how it was written, and what the AI logic is.
> How does the game determine what direction to slide the tiles? Generating the
> highest value tile, or combining the most tiles? (I'm leaning toward the latter)
Yes I wondered that too, it looks like the answer lies in the "move"
function of "game_manager.js", but I don't have time to try and
understand it right now.
Post a reply to this message
|
![](/i/fill.gif) |