Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: King Thirteen: 2048 with chess pieces, in under 13 KB (js13kgames.com)
269 points by animuchan 5 months ago | hide | past | favorite | 80 comments
The game is vanilla JS, with SVG for graphics. Written for the js13kGames coding competition.

Notes on the game design: https://mvasilkov.animuchan.net/king-thirteen




This is just incredibly fun, congratulations! It reminds me of "Really Bad Chess" which I also love: https://play.google.com/store/apps/details?id=com.noodlecake...

Two things, one on-topic and the other off-topic:

The thing which makes 2048 moderately easy to reason about is that incoming pieces are always "1". However, this game appears to spawn in random pieces, with random point values. I tried to follow the to-and-fro of the design blog in order to find out why this is, and I get the impression it's for avoiding getting the player stuck, but it does have the disadvantage of making planning incredibly hard. The good news is that by reading the blog I finally understood what was going on with the screen shake

off-topic: that "Subscribe to me blog" modal is not only bad UX (imho, of course), but also doubles down on the UX tire-fire by resetting my reading position to the top of the page. It's almost enough to warrant a command-w right there. Just one datum, but it for sure made me sad


Thanks a lot for the kind words!

I was afraid people would abandon good runs if too long, so started spawning 4 and 8 sometimes to speed it up somewhat. (There's 180-odd entries participating in the compo, so even 10 minutes of play time per entry is a huge commitment for people looking to vote on most / all games.)

Re: Subscribe popup: this is the sole reason I'm looking to migrate from Hashnode! All of their UX "improvements" are egregious, but this one surely takes the cake. I very much agree with your sentiment.

When I joined, it was a nice technical writing-oriented site, but these days it has entirely succumbed to terrible product managers. E.g. their blog post editor's main function is seemingly to upsell their generative AI wrapper.


Thanks for sharing!

I'm seconding the "incredibly fun" comment, but I would keep the occasional big numbers. It probably took me an hour to finish the game and I wouldn't want to slow it down further. The little extra bit of randomness/luck it adds is nice too.

When it comes to the UI, I was a bit confused about how the gameover and piece removal works. I guess if there are no legal moves it removes a piece?

Also, the multiple move mechanic where the last piece to move is automatically preselected sometimes tripped me up a few times and caused me to accidentally downgrade a piece.


The king will "kill" one of your pieces if he has no other legal moves, but only if you are not one move away from losing. I also noticed this very late, same as noticing that you only need one piece with value 1024 to win the game, because another one is already on the board ~


> a huge commitment for people looking to vote on most / all games.

I wanted to say that I went to vote for your game but they seem to only support GitHub login and their GH app does crazypants shit like "Act on your behalf" versus the much more sane "user:email"[1] or whatever which would prove that I'm a person without granting some rando website "sure, bro, take GitHub actions for me"

So, my HN upvote will have to suffice for Internet Points of Appreciation

1: https://docs.github.com/en/apps/oauth-apps/building-oauth-ap...


The site only requests read access to your email, as the login flow message _actually_ shows.

The "act on your behalf" statement is GitHub's standard message for all GitHub apps, regardless of whether they actually ask to be granted any permissions that would let them perform such actions. There's a "learn more" link right at that statement, that would've explained pretty much exactly this. I find it curious that you bothered to venture into docs and link them, but did not bother to click _that_ one to understand what's actually going on.

It says, i.a.: "The GitHub App can only do things that both you and the app have permission to do.". Since the site only asks for read access to your email address, it cannot actually do anything else. As simple as that.


I hear you, and it's possible you're right, but that's not what the dialog said and the very link that you mentioned has -- as its very first sentence -- "Once you authorize a GitHub App, the app can act on your behalf." and shows an example of commenting as me

So, I guess just to vote on a cool game I should definitely roll the dice with my github account and trust that some Internet comment is right, or, I guess upvote and be sad for them that they tried to be kewl by creating a GH app instead of oauth2 like a sane person. Naming it "Kilobot" for sure inspires confidence for its fewer than 1k installed users, too


Once again, curious that you bothered to remember something that is relevant to community inside jokes and take dumps on that, even bothered to remember a number, but did not bother to read up on what you're dumping on.

FYI #1 It very much is a standard oAuth2 flow. Just GHs 'always on' message is unfortunate, and that's all there is to it. There's been topics like https://github.com/orgs/community/discussions/37117 on this ever since they had been introduced. Which, again, you could've encountered if you put your energy into good faith, instead of focusing that bad faith mojo on a small community. If you really feel like proving how "sane" and above "kewl" you are, go take your dump on GitHub - i.e. the one actually responsible for those misleading messages.

FYI #2 Your vote would not count anyway, because only community member votes actually get included in scoring. Although as an outsider you'd been welcome to leave feedback.


I didn't have to "remember," they're on the tab right next to this one. I'm sorry you're butthurt about someone wanting to vote who isn't a part of the l33t insiders club. Anyway, right under the game in question it says "Voting for this edition's games is in progress - sign in to vote on this game." so how would any sane person know that it's only for insiders?

Sorry I raised your bloodpressure about something that doesn't matter to you since I'm an outsider. I'll send you virtual flowers using my totally safe GitHub App


GitHub has been a partner of the competition for years now. They help actively promote it, participate in providing feedback to contenders, integrate it with the platform (https://github.com/topics/js13kgames). The competition is organized by https://stars.github.com/profiles/end3r.

But yeah, sure, you're free to tell yourself whatever you want.

And no, it's not only for insiders - thus the message. Outside votes get whitelisted when they meet the compos fairness criteria. It's not a popularity contest. Your vote would not count on this basis (amongst others).


Thank you! :) And yeah I'll ask the orgs why does the bot request these permissions, might be an oversight.


Every version of 2048 I've played spawns 2s and 4s. 4s are more rare.


Please consider crediting Threes, not 2048 as the "ancestor". The designers of threes have a well-written blog post on how they feel 2048 ripped them off. It's a good discussion on iteration in game design, among other topics.

https://asherv.com/threes/threemails/


Thanks for sharing this! I had no idea, will add this to the repo's README.


Numberwang is the true OG


Very nice work, congrats!

The combo UI just doesn't work for me. I didn't understand what was happening until reading the blog post, the game just felt broken since it was inconsistent whether a piece maintained focus or not. And even after knowing about it, I was constantly making misplays due to clickin on a unit I wanted to move, and instead having the pre-selected unit capture the clicked unit.

It might be worth trying out a model where the combo piece is highlighted graphically, but you still need to first click on that unit first if you want to move it.


It would be nice to disable sound completely.

When the board is almost full, it's difficult to know which pieces can move. Perhaps add some green shade to the ones that can move.


Thanks for playing! :)

Both are on the list of improvements for the final version — couldn't get the fixes in time for the compo deadline.


I won my second game :) Then I read the instructions :)

(I think it's worth reading the instructions / design discussion, even for someone that is not going to play the game.)

[spoiler alert?]

I didn't realize the "combo" mechanics, but I intuitively made many combos because I usually used the bigger piece to capture the smaller piece. So, for e it's a success in the design.

Is it possible to win only with knight? My strategy was to keep alive as many queens as possible.


Yup Knight-only was possible, but clunky. Queens sure provide a nice power spike towards the end.


Loved the little twist on the mechanics of 2048, instead of just mindlessly pushing down-left-down-left most of the time, you actually had to think about the proper moves of the pieces. Nice to add a second dimension onto the play, had my rusty wheels turning for a little bit before it bit me.


Looks very nice, but definitely needs some explanation, not everyone is familiar with 2048. Not that the website even mentions 2048 :P


I didn't see any rules/explanation of how to play Is that intentional or maybe I'm missing it on mobile?


> How to play: > Join forces > Claim the throne > Revel in glory

It's on the page before you start the game. I also cannot find any instructions once the game is started.

It might as well not have any instructions because it really doesn't tell you anything about the rules or win conditions.


I also don't see any on desktop, neither on the linked page nor ingame.


As a colorblind person I didn’t know there was multiple colours until very late


I'm not colourblind, but found the colours weren't useful at all (compared to 2048). They're just too similar and you need to rely on the numbers, which takes more thinking


I don't think the colors mean anything. But I don't know.


OMG, I had no idea either!


Really enjoyable. Only after my 1024 piece got captured did I see the undo button.

Managed a score of 6,000 ish. What a nifty twist on a couple of old games.


Really nice little game! I instantly got addicted to it, but managed to "beat" it already on the second of two very long tries, so maybe a tad bit too easy? Some observations:

- I noticed very late that the king will actually "kill" (or capture in chess terms) my pieces if "cornered". While this is a nice feature, even if it doesn't happen when the player is just one step away from losing, it still prolongs the game even more.

- I also noticed very late that I can win the game by capturing the king with a 1024 piece (in my case it was a queen). I only found out because I got into the habit of selecting all pieces in turn to check what moves were possible. I hope I'm not spoilering right now :)

- Would be nice if you could capture a screenshot of the final board without the "you win" overlay. I don't have a Twitter account and no, I'm not going to create one just for this game ;)

- Also would be nice if the score (maybe also the current highscore, like in 2048) would be shown somewhere during the game, not just at the end.

- One nice feature is that the game remembers the current state if you leave the browser tab open, so you can shut down your PC and return to it the next morning - badly needed also, because the games are really long...


Scored 9876 and won it on first run but i did use the undo button! :) I stumbled the first half a bit but got the hang of it in the end and after finishing it I think i had more fun than original 2048. This is because this game requires you to carefully place the pieces each time while in original 2048, you could get to 1024 with just a lot of repeated movement (down+left for me) to group all biggest numbers to a corner


Super cool game! I sunk well over an hour into it, but I rage quit when the king stole my 1024 piece...I didn't realize that was an option. In retrospect, I guess that's what the shaky screen meant.

This was my game just before I stopped (the 1024 was next to the 256): https://ibb.co/gv0QR89


The king is worth 1024, so as soon as you have a 1024 piece on the board you can capture the king to make 2048 and win the game


Then maybe he shouldn't be King XIII, but King MXXIV ;)


Really fun game, well done. People are complaining about the rules not being clear enough but IMO figuring out the rules as I went along was (unexpectedly) part of the fun. I had no idea how to win (or if the game even could be won) until I realised that my queen was now the same colour as the king, and then the penny dropped.


Great idea for a game and very playable. As others have said, it is much more interesting than 2048 due to the reduced repetition. It still seems beneficial to stack high value pieces out of the way (e.g. your biggest in the corner and then next biggest on an adjacent edge square). Towards the end it was getting quite frustrating having rooks appear in corners, but a good kind of frustrating!

Could the score be visible during the game to give a sense of the scoring rules? I didn't know the king eats pieces until I read the comments here... I would expect that to lose you points, but hard to tell unless the scoring is maybe documented somewhere I missed?


Hey, fun Game. Took me a few rounds to find the right strategy (which is spoiler ... The 2048 strategy to aline powers of two on the border, which for me often lead to a sequence of Queens) and then it's unfortunately leading to the 2048-problem that one plays relatively simple strategy with annoyance by random generator ... it is a bit better as one needs "powerful" figures on the sequence (while not having a queen once can be fixed by the next queen ...) and can be interesting to force the king into a corner and locking it there. Were quite a few fun rounds, but I think I am "through" especially as it stops on the 2048, just like the original 2048 did.


This is how sustainable software development should work. Not a 100 MB iPhone app or a 60 MB Android app.

Or 600 MB as in https://news.ycombinator.com/item?id=41459629


This song is amazing, it's like midieaval FTL. The game's good too.


What song actually is it?


It's a variant of Magical Power of the Mallet, composed by ZUN of Touhou fame.

https://www.youtube.com/watch?v=VAdcF2IdyZY


It sounds like a chiptune remix of "Kobito of the Shining Needle ~ Little Princess" from Touhou 14.

https://www.youtube.com/watch?v=jv1yYDzvFtQ


Didn't even know this melody was reused for several different tracks in Touhou! Thanks for posting this.


Dang that king is bloodthirsty. I played for a while and it ate all the best blocks I ever made (a 512). Can my high score be the best I was doing before I lost it all?


Took me a while to realise, but I think the king only eats blocks when it is completely cornered and has no other space to move ... ?


This is gonna destroy sooooooooooo many engineering school GPAs.


This game was way too good. I stuck with it until I beat it and loved everything - the music, the idea, and the moves felt so satisfying - especially the final one.

The first time I played I thought king would take my pieces with some probability if they weren't guarded. I spent way, way more effort than was necessary playing with higher stakes.


I thought I'd lose if the king was trapped—like some sort of stalemate—so I played through the game with that in mind. It might make for a fun variant.

I should add I didn't expect to find the rules in the Post-mortem, so I gave up on that after skimming through the page and jumped right into the game.


If the king is trapped he eats the highest-scoring neighboring piece and takes its spot.


It's worth noting if the board is full this doesn't happen. This was helpful in my strategy because I could set up several pathways like I was playing checkers without fear of losing anything.


This game is so fun! I spent entirely too much time playing it just once last night, and got to the 1024 piece in the first run. I don't know how long it took me, but it was long. With 2048 my runs are far quicker.


Was not expecting Touhou music!


Kobito of the Shining Needle ~ Little Princess (https://www.youtube.com/watch?v=jv1yYDzvFtQ) is one of my favorite Touhou songs.


Fun game! Won on my first try and it felt a satisfying playthrough. Still don't fully understand the rules.

Eg. Are new pieces random? Since the king can eat clutter does that prevent you from losing?


The "game design" link above offers insight into the rules and nuances of the game. Eg:

The King resorts to violence only when he is cornered and has nowhere else to go. It's below him to kill commoners otherwise.

If there's no unobstructed path for the King, he will take the highest-value piece in his vicinity. However if you might lose due to the board being full, then the King won't help you by clearing the board; he'll just skip his turn.

Also, free tip: The King's value is 1024 if you want to contemplate regicide.


You could code this on to an old 8 bit microcomputer ("micro" as in "not mainframe"!). I would have loved playing this in 1988!


I had so much fun finishing this. Much more interesting than other 2048 variants I've tried. I got a score of 9341.


This is fantastic

I hope you post again when you've made a standalone page and/or mobile versions, this game deserves lots of success :)


Without reading any instructions, I really liked this game... until my top piece got removed. :)


This is incredibly well-done and fun and just plain works!!!! Congratulations!


Incredibly fun, and makes sense now that I have read the design/instructions.


That's a really great game, congratulations!


Love the styling and the music, great job!!!


This is great. Good job.


This is awesome


I don't understand the rules for when a piece is allowed to capture another piece.

EDIT: Oh, a piece can merge with any piece that has the same numerical value. This makes the game far more playable.


this was a lot of fun, great job


mmm honestly at some point i was wondering if it was actually possible to lose. i tried actively and it took me sooo long. Felt like the numbers were actually coming specifically to help you have moves


  How to play:
  * Join forces
  * Claim the throne
  * Revel in glory
No really... how to play?


The "notes on the game design" page tells how it works. https://mvasilkov.animuchan.net/king-thirteen


It's just like the game 2048, except with chess pieces. There's a 'play' link at the top of the page.


It's not just like 2048 though, since you only move one piece at a time. In 2048 you move all the pieces in the same direction at the same time.


Indeed, that was the first thing I tried (using arrow keys) and when nothing happened I said, "Oh so it's not like 2048 at all, okay... let me check the game instructions since I'm lost now."


and then there's no instructions :clownemoji


agree! how to play??? I found I can click and join knights by knight move with the same subscripts. but what is the king doing? there are no directions and its not obvious!


The king has just taken my largest piece after no moves were left. I guess when you reach 2048, you can take the king and win.


Apparently he is worth 1024 so you can take him when you have a 1024 piece, and win. I didn't realise this (or that he takes pieces when cornered - I avoided that, assuming a stalemate would mean losing) so played it right through to a regular 2048 which took a verrry long while.


Open game. Random clicky. Ah!


Yeah I am very confused. This isn't like 2048 at all. The pieces move individually? And why are there multiple different colors of knights? What is the king doing? How do I mute the game entirely?

Interesting take but needs some more polish and a good demo video or something.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: