TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: 1024, a 2048 Puzzle Game

101 点作者 fuegoio将近 3 年前

16 条评论

selectnull将近 3 年前
Just like few others here, I wanted keyboard shortcuts so I just hacked it quickly. Will break if DOM classes change, but author should implement something better.<p>Cool game.<p>```<p>const rotate = (direction) =&gt; { const directions = {counterclockwise: 0, clockwise: 1}; const buttons = Array.from(document.querySelector(&#x27;.mt-16.flex.items-center.justify-between.w-72.h-12.px-2&#x27;).querySelectorAll(&#x27;div&#x27;)).filter(el =&gt; el.className === &#x27;&#x27;); buttons[directions[direction]].click(); }<p>document.addEventListener(&#x27;keydown&#x27;, (ev) =&gt; { switch (ev.key) { case &#x27;ArrowLeft&#x27;: rotate(&#x27;counterclockwise&#x27;); break; case &#x27;ArrowRight&#x27;: rotate(&#x27;clockwise&#x27;); break; } });<p>```
评论 #32410152 未加载
评论 #32414998 未加载
beeforpork将近 3 年前
Nice game! Thanks!<p>Some proposals to improve usability:<p>The game should notice a stalemate and tell you that you lost (no matter how you rotate: no more progress is possible).<p>The game should accept a hit of &#x27;Return&#x27; to start the new game (it currently seems to insist of mouse interaction).<p>The game should have a &#x27;fast&#x27; mode with less animation so that I can play faster. A single move takes too long! I am impatient! :-)
评论 #32410910 未加载
eganist将近 3 年前
You have a pause in there where the tiles take a moment. Please let us use that pause to rotate a second time before the tiles fall so we can also get the pieces to move across the board rather than just slide parallel.
评论 #32408834 未加载
评论 #32408472 未加载
评论 #32415712 未加载
评论 #32410710 未加载
justinator将近 3 年前
That was fun! But I was able to solve the puzzle by continually rotating the same direction.<p>I bet this was tried, but what&#x27;s play like with the same game mechanics of this version, but with the original game play, where each move gives you a new block?
评论 #32406901 未加载
评论 #32406183 未加载
评论 #32406219 未加载
评论 #32406291 未加载
评论 #32407035 未加载
donatj将近 3 年前
Are there any keyboard shortcuts to this I&#x27;m not finding? Really needs keyboard shortcuts.
评论 #32410155 未加载
eyelidlessness将近 3 年前
Thanks, I love and hate it!<p>I’ve been obsessively playing another 2048 variant which was a recent Show HN[1], and has confounded me since. Yours has a much gentler learning curve and obviously isn’t designed to be unbeatable. Rotating the whole board will probably continue confounding me in entirely different ways.<p>1: <a href="https:&#x2F;&#x2F;www.adversarial2048.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.adversarial2048.com&#x2F;</a>
评论 #32406966 未加载
dalmo3将近 3 年前
I don&#x27;t get it. The numbers add up to 128. Then what?
评论 #32407386 未加载
评论 #32406903 未加载
评论 #32406949 未加载
armchairhacker将近 3 年前
Suggestion: make it so that arrow keys (left, right) rotate the board.
评论 #32406038 未加载
评论 #32410157 未加载
评论 #32406203 未加载
valbaca将近 3 年前
Neat!! but please, please support left-and-right keys and better mobile (swipe left and swipe right)
eps将近 3 年前
Excellent.<p>Is each board guaranteed to be solvable?<p>For playing on mobile - it&#x27;s be nice to be able to rotate by swiping vertically down the empty space on the left or on the right of the board.
djbusby将近 3 年前
You have been hugged to death. I&#x27;m getting 503s and other errors from Netlify. Congratulations!<p>Edit: now intermittent errors
noduerme将近 3 年前
I feel like a more interesting piece of code would be one that generated random (but solvable) puzzles and showed what the minimum number of moves was to solve them.
Humphrey将近 3 年前
I initially tried to rotate my phone. It look me a while to notice the buttons. Good 5 mins of fun!
btutal将近 3 年前
I couldn&#x27;t do less than 12 but definitely fun to play!
nwsm将近 3 年前
Ouch, I wasn&#x27;t expecting to get in a stalemate position by turn 15
t_a_v_i_s将近 3 年前
Fun! My best score is 13. Do you plan on randomizing the start?