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 still WIP.
Supported Platforms
- iOS 13.0+
- macOS 10.15+
- macOS 11+ (macCatalyst version)
License
MIT
CardGameEngine Prototyping a game engine for the Bang card game. Features Engine is open source Powerful scripting language using JSON Card design is
TicTacToe Tic Tac Toe game developed in SwiftUI Requirements macOS 11.1 Big Sur Xcode 12.3 iOS 14 Getting Started Clone the Repository Royalty free au
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
A Simple iOS Game App - Designed in SwiftUI 🚀 The game's aim is to make a cap to fill the color among them. On tapping any shapes, it will rotate 90
The Classic game TicTacToe made using SwiftUI and MVVM architecture
swiftui_war Simple SwiftUI War Game My implementation of: https://codewithchris.
ConnectFour About A simple Connect Four game built entirely with SwiftUI. Through working on this project, I have learned that the upsides of using Sw
This is a demo to build a little mini-game "for babies". It's inspired in this kind of games:
DarnWordle A SwiftUI retro of Wordle, the W* game Motivation Well, the game look
Put BlockGrid inside of a drawingGroup for better performance. The same method was applied in: WWDC 2019 Session 237 - Building Custom Views with SwiftUI
Changes:
https://github.com/unixzii/SwiftUI-2048/blob/34f315a4103527eac366403b9e4632326cc2f257/SwiftUI2048/Models/GameLogic.swift#L131
This function can be optimized like this so that it can create any nums of blocks.
@discardableResult fileprivate func generateNewBlock() -> Bool {
var blankLocations = [BlockMatrixType.Index]()
for rowIndex in 0..<4 {
for colIndex in 0..<4 {
let index = (colIndex, rowIndex)
if _blockMatrix[index] == nil {
blankLocations.append(index)
}
}
}
guard blankLocations.count >= 1 else {
return false
}
// Don't forget to sync data.
defer {
objectWillChange.send(self)
}
_blockMatrix.place(IdentifiedBlock(id: newGlobalID, number: 2), to: blankLocations.randomElement()!)
return true
}
@discardableResult fileprivate func generateNewBlocks(_ num: Int = 1) -> Bool {
guard num > 0 else {
return false
}
for _ in 0..<num {
if !generateNewBlock() {
return false
}
}
return true
}
https://github.com/unixzii/SwiftUI-2048/blob/34f315a4103527eac366403b9e4632326cc2f257/SwiftUI2048/Models/GameLogic.swift#L74
fixed:
if let block = _blockMatrix[axis ? (col, row) : (row, col)] {
rowSnapshot.append(block)
compactRow.append(block)
} else { // add else here
rowSnapshot.append(nil)
}
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. S
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
ShellSlide - Play 2048 in your shell ?? Features Keep track of your overall highscore Easily save and resume your games Installation (macOS only) Down
SwiftUI Game A little arcade game that uses SwiftUI as a game engine :) Just copy the code into the Blank playgroundbook in Swift Playgrounds app on i
IOS_Spin_Game A simple spin game using Swift UI.
4X MMO Strategy Game for iOS I have spent 4 years of my life and a significant amount of money into completing this game and I hope you enjoy it. For
Matchimals.fun an animal matching puzzle card game ?? ?? ?? Download for iOS from the App Store ?? Download for Android from the Google Play Store ??
Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.
GravitySwitch Gravity Switch is a dynamic game that integrates swiping and tappi
Flag Guess Game A game to collect points by guessing flags! Wrong Choice