Skip to content
2048 game using SwiftUI and Combine
Swift
Branch: master
Clone or download
Latest commit 0bf7723 Sep 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
twofortyeight feat: add moves view Sep 19, 2019
.gitignore
LICENSE
README.md

README.md

2048 Game

The 2048 game remake using SwiftUI and Combine

You can find an article explaining the implementation here: Medium


🕹️ The Game

2048 is a single-player sliding block puzzle game designed by Italian web developer Gabriele Cirulli. The game's objective is to slide numbered tiles on a grid to combine them to create a tile with the number 2048. However, one can continue to play the game after reaching the goal, creating tiles with larger numbers.

🚂 Motivation

After watching a series of The Coding Train on how to implement the 2048 game in JavaScript with P5, I got the inspiration to do the same with SwiftUI and Combine. So some of the logics behind matrices manipulation I borrowed from Mr. Daniel Shiffman (Keep inspiring people with your videos <3).

💻 Requirements

  • iOS 13+
  • XCode 11

🤓 How to run

Since this project has zero dependencies on external frameworks, all you need is:

  • ⌘ + R (and that's it)

☑️ Todo

  1. Stats (number of moves, time played, etc)
  2. Work on the animations (there's no animation for shifting tiles along the board for example)
  3. A way to UNDO an action. (thanks @rcaval for the suggestion!)
You can’t perform that action at this time.