https://github.com/marianapatcosta/my-hex-2048-game
Hexagonal version of the popular 2048 game
https://github.com/marianapatcosta/my-hex-2048-game
game jest react react-testing-library responsive-design scss scss-modules typescript web
Last synced: 9 months ago
JSON representation
Hexagonal version of the popular 2048 game
- Host: GitHub
- URL: https://github.com/marianapatcosta/my-hex-2048-game
- Owner: marianapatcosta
- Created: 2022-02-04T22:09:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-30T15:25:21.000Z (almost 3 years ago)
- Last Synced: 2025-01-11T23:17:38.021Z (10 months ago)
- Topics: game, jest, react, react-testing-library, responsive-design, scss, scss-modules, typescript, web
- Language: TypeScript
- Homepage: https://marianapatcosta.github.io/my-hex-2048-game/
- Size: 716 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hexagonal 2048
Hexagonal version of the popular 2048 game developed with React, TypeScript and SCSS-modules; includes unit tests. This game has has different levels, as the player can choose the number of hexagons to display. The game ends when the uscoverer wins (i.e. a hexagon cell has a value of 2048) or when there are no more possible moves.

## How to Play
Move the numbers in the hexagon cells towards one of the 6 possible directions, by pressing the corresponding keyboard keys (see the table below). The player should match adjacent cells with the same value, so their value in summed and merged into one cell (e.g. 2 2 -> 4). The player wins when a cell has 2048 as a value. These are the available command keys:
| Direction | Keyboard key |
| ------------------------- | :----------: |
| north (top) | w |
| north-east (top-right) | e |
| north-west (top-left) | q |
| south (bottom) | s |
| south-east (bottom-right) | d |
| south-west (bottom-left) | a |
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `yarn test:unit`
Launches the unit test runner in the interactive watch mode.
### `yarn test-coverage:unit`
Launches the unit test runner in the interactive watch mode and shows tets coverage report.
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.