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
Touchdown-SwiftUI E-commerce app built in SwiftUI. Built in the course SwiftUI Masterclass in Udemy. Main components and concepts used: @EnvironmentOb
WikiDemo A multiplatform SwiftUI project demonstrating various SwiftUI features, including creating a master-detail interface. It's a multiplatform ve
SwiftUI Masterclass Repos: AsyncImage (N/A) Fructus (finished): an app for getting information about different fruits. Data comes from json files. Afr
Best architecture for SwiftUI + Combine The content of the presentation: First of the proposed architectures - MVP + C Second of the proposed architec
weather-swiftui An example of using SwiftUI Installation Get openweather api key
Orbit is a SwiftUI component library which provides developers the easiest possi
SwiftUI_Resume a simple "resume" writed by swiftUI + Combine
SwiftUI-MSALSample I could not find a good walkthrough on how to implement MSAL
Hacking with SwiftUI 100 Days of SwiftUI Studying through Paul Hudson's "100 Day
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)
}
Life Conway’s Game of Life SwiftUI implementation of Conway’s Game of Life — also known simply as “Life”. About I’m Martin, an indie dev from Berlin.
isowords This repo contains the full source code for isowords, an iOS word search game played on a vanishing cube. Connect touching letters to form wo
SwiftUI-LifeGame The Conway's Game of Life that build with SwiftUI. iOS iPad macOS Requirements Xcode 12.2 (beta 2) macOS Catalina macOS Big Sur (beta
Hello, there! Welcome to The Tic_Tac_Toe IOS Applicaition The Aricah Cross platf
Riddler is a riddle game built as a native iOS app in Swift using SwiftUI. It includes 50 challenging riddles with hints for when you get stuck. The game tracks your stats so you can compare your performance against your friends, and see who can answer all 50 riddles the quickest.
CheatManager CheatManager is a mobile platform, used for installation/distribution/creation of mobile game cheats/hacks. This platform is completely d
Game Data System - GDS Author: Heitor Silveira (heitorsilveirafurb@gmail.com) iOS App to view games from various platforms, their description, release
TicTacToe This is Tic Tac Toe game :) There are two players, Player X and Player
TicTacToe Ultimatum An iOS app in Swift implementing the classic game of Ultimat
WatchShop_UI A simple SwiftUI Application to demonstrate creation of UI using SwiftUI. How to run the project ? Fork the project. Run the project usin