2048 for Swift

Related tags

Games swift-2048
Overview

swift-2048

A working port of iOS-2048 to Apple's new Swift language.

Like the original Objective-C version, swift-2048 does not rely upon SpriteKit. See the description for iOS-2048 for more information.

I'm not actively working on this, except to fix bugs and maintain compatibility with latest versions. Pull requests are welcome, though. Note that Swift was very different back when I first wrote this code, caveat emptor.

If you want to check out a more advanced Swift project, please take a look at Lambdatron, my Clojure interpreter.

Instructions

You will need Xcode 7 to run the project. Run it in the simulator or on an actual device.

Tap the button to play the game. Swipe to move the tiles.

Thoughts on Swift

Swift is a well-designed language that will, hopefully, drag mainstream programming halfway to ML (kicking and screaming the entire way, of course).

If you really want to see my out-of-date thoughts on Swift, check out the git history for README.md.

License

(c) 2014-2015 Austin Zheng. Released under the terms of the MIT license.

2048 by Gabriele Cirulli (http://gabrielecirulli.com/). The original game can be found at http://gabrielecirulli.github.io/2048/, as can all relevant attributions. 2048 is inspired by an iOS game called "Threes", by Asher Vollmer.

Comments
  • Question regarding licensing

    Question regarding licensing

    The source code states that all rights are reserved, which to me means closed-source, but the LICENSE file says that this is under MIT. Just for clarification, which license, if any, is being used?

    opened by flaw600 4
  • Spiced up the UI and corrected score logic

    Spiced up the UI and corrected score logic

    Awesome work on the initial implementation! I wanted to play around with Swift so I made a few improvements to the project.

    • UI
    • Fixed UIAlert Bug
    • User now get directed to the main screen after game ends
    • Scoring
    • Best Score
    opened by RyanBertrand 3
  • UIAlertView

    UIAlertView

    I noticed here that you have commented out UIAlertView. You can still create UIAlertViews by using an empty constructor and setting all the fields in the init method manually.

    Just wanted to let you know!

    opened by smswz 1
  • Migrate to Swift 3

    Migrate to Swift 3

    Migrate to Swift 3.

    Most changes were performed by Xcode's conversion tools; I also changed some function prototypes to follow the latest style guidelines.

    opened by PumpMagic 0
  • Build fixes for Xcode6-Beta7 on OS X 10.9.4

    Build fixes for Xcode6-Beta7 on OS X 10.9.4

    I just removed 'value: ' in the spots that the debugger was telling me. This allowed me to successfully build and play the game. The first commit changed the tab indentation so I made a second commit to match the original file's indentations.

    opened by Jlong33 0
  • Recommendation for iOS 13 and more

    Recommendation for iOS 13 and more

    Apple introduced a new default card presentation. And vertical scroll is not working because it scroll cardview. In order to force the fullscreen you have to add in the file NumberTileGame.swift -> end of init() line 45 -> add next code:

    self.modalPresentationStyle = .fullScreen

    opened by bpatapb88 0
Owner
Austin Zheng
I do things with computers.
Austin Zheng
The iOS version of 2048, made using SpriteKit

2048 This is a derivative and the iOS version of the game 2048. In the very unlikely case that you don't know what it is, you can check it out here. M

Danqing Liu 1.1k Dec 31, 2022
A 2048 game writing with SwiftUI.

2048 Game (SwiftUI app) This is a simple game to demonstrate the new SwiftUI framework. Note that the game algorithm may have issues, and this is stil

Cyandev 645 Jan 3, 2023
ShellSlide - Play 2048 in your shell 🎮

ShellSlide - Play 2048 in your shell ?? Features Keep track of your overall highscore Easily save and resume your games Installation (macOS only) Down

Carl 1 Mar 28, 2022
Swift-WordleSolver - Solve and analyze Wordle games. Command-line tool written in Swift

Swift-WordleSolver - Solve and analyze Wordle games. Command-line tool written in Swift

Tobi Schweiger 0 Jan 26, 2022
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

John Sundell 1.8k Jan 3, 2023
Sage is a cross-platform chess library for Swift.

Sage is not a chess engine; it's a move generator. Hexe, on the other hand, is able to both generate moves and evaluate them.

Nikolai Vazquez 368 Dec 29, 2022
🐦 Flappy Bird reincarnation [Swift 5.3, GameplayKit, SpriteKit, iOS 12].

?? Flappy Bird reincarnation [Swift 5.3, GameplayKit, SpriteKit, iOS 12].

Astemir Eleev 290 Dec 27, 2022
A game engine built with SDL and Swift.

Lark A game engine made with Swift and SDL. This is a pre-alpha work-in-progress. Don't try to use this unless you really know what you're doing. I ba

June Bash 41 Mar 11, 2022
A Swift package for Raylib. Builds Raylib from source so no need to fiddle with libraries.

A Swift package for Raylib. Builds Raylib from source so no need to fiddle with libraries. Just add as a dependency in you game package and go!

Strega's Gate 62 Dec 29, 2022
A simple Chess game for iOS, written in Swift

Swift Chess This is a simple chess game for iPhone and iPad, designed for novice players. It features a very simple AI that plays much like a beginner

Nick Lockwood 135 Jan 6, 2023
swift implementation of flappy bird. More at fullstackedu.com

FlappySwift An implementation of Flappy Bird in Swift for iOS 8. Notes We're launching a course Game Programming with Swift If you are interested in e

newline (formerly Fullstack.io) 9.5k Dec 29, 2022
iOS Swift Game - Push SpriteKit to the limit

iOS Swift Project - Legend Wings - EverWing's Mini Clone EverWing is a popular action game. Survive as much you can, earn gold, and upgrade/purchase n

Wong Guan 512 Dec 20, 2022
Simple memory game written in Swift 4 using VIPER Architecture.

Viper Memory Game Simple memory game written in Swift 4.2 using VIPER Architecture. The Memory Game is a deck of cards where the user needs to find ma

Mati 23 Jun 6, 2022
A project introducing you to Swift

?? My first Memory ?? ?? An introduction to iOS development with Swift. A memory game implementation fetching images from Instagram. This project aims

Alexander Cyon 72 Sep 5, 2022
2D ECS game engine in 100% Swift + SwiftUI for iOS, macOS, tvOS

OctopusKit A 2D game engine based on ECS and written in 100% Swift for iOS, macOS and tvOS. If you've tried making a game in Swift while sticking to t

null 335 Dec 12, 2022
Letter Quiz game with swift for ios

LETTERQUIZ Title: LetterQuiz Category: Game Genre: Trivia, Puzzle, Quiz Platform: IOS Language: Swift 4.0 Available at: Developer: Martin Bruland Crea

Martin Bruland 1 Nov 25, 2022
ShogibanKit is a framework (not yet) for implementing complex Japanese Chess (Shogii) in Swift. No UI, nor AI.

ShogibanKit Framework Shogi, or Japanese Chess, is based on very complex rules, and it is hard to implement all basic rules. This ShogibanKit aims to

Kaz Yoshikawa 62 Jul 16, 2022
Swift framework for working with Tiled assets in SpriteKit

SKTiled is a framework for integrating Tiled assets with Apple's SpriteKit, built from the ground up with Swift. This project began life as an exercis

Michael Fessenden 235 Dec 20, 2022
Swift framework for loading various 3d models in SceneKit

AssetImportKit AssetImportKit is a cross platform library (macOS, iOS) that coverts the files supported by Assimp to SceneKit scenes. Features AssetIm

eugene 74 Nov 30, 2022