The 2048 game, playable with keyboard arrows and touch swipes.
See it live https://amatiasq.github.io/2048-game/
Run the following commands at the root directory.
npm i
npm run dev
You can also use npm run build
to generate static distributable web files.
The follwing values are configurable in /src/config.ts
HAS_OBSTACLES
Set it to false to disable obstacles, this will remove them from the UI and also make the obstacle value (-1) an invalidCellValue
for typescript validation.COLUMNS
andROWS
define the size of the playable gridINITIAL_CELL_VALUE
is the value of the cell created at startSWIPE_CELL_VALUE
is the value of the cell created on every swipeWIN_VALUE
when this value has been reached the player has wonALLOW_CONTINUE_AFTER_WIN
is self-explanatory, the timer is stopped once 2048 is reached though
Also there is a CSS custom property at #app
called --scale
, use it to change the size of the whole application.
It can be changed live from the browser developer tools.