by terabytest · 12y ago · 0 comments
I made this game as a fun weekend project, inspired by another game called 1024 (https://itunes.apple.com/us/app/1024!/id823499224) and a spinoff called 2048 (http://saming.fr/p/2048/). I did mine to add animations to the latter, which was a bit hard to play without them.
I discovered Threes only today, and I had no idea it looked so similar. I searched a bit and it appears as if 1024 is also inspired by Threes, so my game is probably the last of a long chain of clones :P
The code is also open-source. You can find it here: https://github.com/gabrielecirulli/2048
Feel free to ask me anything, and thanks to everyone for the attention! :)
By the way, my highscore is somewhere around 6000. Admittedly, I'm quite bad at playing my own game :P
EDIT: Make sure not to get addicted!
EDIT 2: The game now has swipe gestures and vim keys support (added by @rayhaanj)!
Won a few times and still keep picking it up. Now the Tetris dreams are starting; must stop.
This sort of clicked towards, oooh I don't know about 1:30am this morning.
Note: shameless parody plagarism, (original: https://news.ycombinator.com/item?id=7386459), but this thread has 20x points.
Edit:
Actually all you need to store is the highest block achieved, and the number of times it's been hit. For instance, if you've only ever generated 2 8's, then you know that you've had 4 4's, and 8 2's...
Edit 2: Does the game allow four 2's to cascade into an 8? If so, maybe you could also store combo stats. It'd be way cooler to smash together four 256's than to smash together two 256's two times.
Not sure how that plays into the histogram.
You know you've had at least 4 4's, but you could have had more.
Upvoted you to show my anger! :)
https://developer.mozilla.org/docs/WebAPI/Detecting_device_o...
Just in case anyone is looking at this and wants a direct link to play pavel_lishin's version, here's the raw github version: https://rawgithub.com/pavellishin/drop7/master/drop7.html
Side note: I got hooked on Drop7 during my first semester in college. I was fascinated by the game and wrote a simulator to pick the optimal move: https://github.com/keshavsaharia/Drop7Simulator
Nice clone but it's definitely a clone and so should be treated as such.
It's good to get paid for your work, even if it was fun.
EDIT: oops, there was a bug in the win/lose tracking so I probably missed out on a few wins. I fixed it now, so it should hopefully track it if someone else wins!
At least I don't have to spend any more time on it.
My simple strategy was to keep the biggest blocks in a corner at all times.
Hah. It's binary crack.
There are a couple of brute force approaches: a) always pick the direction that will result in the most blocks to combine, b) always pick the direction that will result in the largest score.
http://forums.toucharcade.com/showthread.php?p=3142737#post3...
Good for beta testing it.
Unlike with Threes, there's no real reason to use numbers since they're all powers of 2. If you used letters (A, B, C, ...) you could market it to non-HN sorts, and have a version of the game in a 5x5 grid, or, more to the point, in a 6x6 grid with letters A to Z. Most people in the world know the order of letters in English.
:-) Hope that's fine. It might take an hour or so for the domain to be accessible for everyone due to DNS cache.
(in case folks on Android want to play it)
edit: Ok, some random friend just emailed me and told me to check out your game. This friend does not hang out at the online places I do. It seems to be on fire!
That's pretty damn near optimal, might have had an extra 2 when doing the final collapse, can't remember.
But seriously, well done. :) Completely destroyed my productivity.
2 * 1024 = 2048
4 * 512 = 2048
8 * 256 = 2048
..
1024 * 2 = 2048
20480 <-- minimum points
is there a elegant formula to get to the minimum required points?I hate you. ;)
Oh, no we have another Flappy Story in the making here!