2048, a simple block moving game that involves movement (controls), numbers & math, in which the goal is to get to the number 2048 by moving and multiplying everything.
2048, a simple block moving game that involves movement (controls), numbers & math, in which the goal is to get to the number 2048 by moving and multiplying everything.
Honestly, I haven’t been to expirienced with JS, this project helped me use math in a more creative and, honestly kinda fun way. I loved testing the project after each small change. Overall, very fun challenge, a lot of research into JS and how to use it. I’m proud of myself for doing around 1 and a half hour in one go and making it work.
Created the files (index.html, style.css, and script.js). In the CSS file, I set the layout to a 4-by-4 grid with squares/rectangles as the board. Then I made it spawn in one play to see if the number goes in the boxes or not, after I made it randomly spawn. Firstly, I added moving to the left, fixed some glitches before adding the up, down, and right movement types. But it didn’t really work too well because I forgot a very important mechanic, merging of numbers, so I made it so that when the same numbers touch, it merges and double the value.
Lastly, I added some smaller features, like the number of moves, total time, score & best score.
Log in to leave a comment