2048 Circle
Kira L

Kira L @i8sumpi

About: I primarily code in JavaScript, but also know many other languages. I absolutely love to program and have loved it ever since I was a little kid. Check out my work at http://kiraprograms.com!

Joined:
Aug 4, 2020

2048 Circle

Publish Date: Sep 28 '20
23 2

For those of you who love the game 2048, please check out my new variation: 2048 Circle!

There are a ton of variations on the game (in fact, the game itself is a variation of 1024), however none have experimented with a non-square board. When the board is a circle, the game becomes just a bit harder to predict, so there is no simple strategy.

I made this game from scratch, not by forking the original game. If you are interested in making your own 2048 variation, check out the GitHub repository. Using some fancy array tricks, I was able to create the whole thing with just around 200 lines of JavaScript.

Lastly, check out the product hunt page for more info.

Hope you enjoy!

Comments 2 total

  • amt8u
    amt8uSep 28, 2020

    If you have not copied and created the game by yourself. Good Job:-)

    Just a suggestion though - You can create functions in your move.js file. I can see the below line repeated having mostly the same logic.

    tiles.filter(i=>i.x==0).sort((a,b)=>a.y-b.y).forEach((item, index, all)=>{item.yN=index+2; checkSame(item,index,all,"y",-1);});
    
    • Kira L
      Kira LSep 28, 2020

      The function checkSame does that partly. You might notice that each line is a little bit different based on the location and direction, so I found it easier to just write this part out.

Add comment