Skip to content

Build Minesweeper in React Native with Expo. Used TailwindCss to style the app.

Notifications You must be signed in to change notification settings

Vincy-Cheng/Minesweeper

Repository files navigation

Minesweeper

This Minesweeper is built in React Native by Expo. And used TailwindCss for Styling. I used Redux to store the data to restore the game data after users reopen the app. And I imported Google Font - IBM_Plex_Mono for styling.

Important

It only tested the local development with iPhone 14 Pro simulator.

Prerequisite

  1. Xcode
  2. NodeJS

Local development

  1. Install Expo CLI globally npm i -g expo-cli
  2. Install the required package by npm i
  3. Launch the app with expo start --dev-client and then enter i for choosing ios system.

Game Description

It is a classic game called Minesweeper which you can design the board size and number of bombs by yourself. (The app will be very lag if you create a large board, e.g 100 x 100) There is a timer for recording your play time and a bombs counter that shows the number of bombs left.

image

You can also restart the game anytime by tapping the restart icon button.

image

There are 2 modes, Flag mode, and Shovel mode.
image image

Under the Flag mode, every tap will be considered to flag the cell. If you long tap the cell, the cell will be flipped.

Under the Shovel mode, every tap will be considered to flip the cell.

If you flipped the bombs, you lose the game.

image

Back to the Home screen, you can choose to start a new game and continue the game. And select the light/dark mode.

image image

And there is a record button that navigates the player to the Record screen which displays the game records. Players can choose to delete all the records.

image
image

Win the Game

  1. Flag all bombs in Flag mode or,
  2. Flip all cells that are not bombs in Shovel mode.
image

Production (Deploy to Expo App Store)

You need to have an Apple Developer account during deployment

  1. Login your Expo account expo login
  2. Build your app npm run build:ios
  3. Publish the app expo publish