All Projects → alex566 → Match3Kit

alex566 / Match3Kit

Licence: MIT license
Library for simple Match3 games.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Match3Kit

Hippolyte
HTTP Stubbing in Swift
Stars: ✭ 109 (+186.84%)
Mutual labels:  swift-package-manager, spm, swift5
MMActionSheet
An actionSheet view implement with pure swift
Stars: ✭ 25 (-34.21%)
Mutual labels:  swift-package-manager, spm, swift5
Table
CLI tables in Swift
Stars: ✭ 53 (+39.47%)
Mutual labels:  swift-package-manager, spm, swift5
SwiftGradients
Useful extensions for UIViews and CALayer classes to add beautiful color gradients.
Stars: ✭ 15 (-60.53%)
Mutual labels:  swift-package-manager, spm, swift5
PagedLists
Paginated UITableView and UICollectionViews for iOS.
Stars: ✭ 69 (+81.58%)
Mutual labels:  swift-package-manager, spm, swift5
TVToday
iOS TV Shows app with TMDb Api. RxSwift, MVVM, Clean Architecture. Tuist + Swift Package Manager
Stars: ✭ 27 (-28.95%)
Mutual labels:  swift-package-manager, spm, swift5
CSV
A simple CSV file parser and serializer
Stars: ✭ 31 (-18.42%)
Mutual labels:  swift-package-manager, spm
EKAstrologyCalc
Astrology Calculator calculates moon's rise/set times, moon Age, moon phases and Zodiac Sign for location and time
Stars: ✭ 31 (-18.42%)
Mutual labels:  swift-package-manager, swift5
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (+5.26%)
Mutual labels:  swift-package-manager, spm
Flexcolorpicker
Modern color picker library written in Swift 5 that can be easily extended and customized. It aims to provide great UX and performance with stable, quality code.
Stars: ✭ 164 (+331.58%)
Mutual labels:  swift-package-manager, spm
FitDataProtocol
Swift Implementation the Garmin Flexible and Interoperable Data Transfer Protocol.
Stars: ✭ 32 (-15.79%)
Mutual labels:  swift-package-manager, spm
Expandable Collection View Kit
🗂 Expandable, hierarchical, flexible, declarative UICollectionView with diffable data sources & SwiftUI-like tree items builder [Swift 5.1, iOS & iPadOS 13].
Stars: ✭ 69 (+81.58%)
Mutual labels:  swift-package-manager, spm
SupportEmail
Pre-populates emails with support information in iOS/iPadOS apps
Stars: ✭ 20 (-47.37%)
Mutual labels:  swift-package-manager, spm
xcframework-maker
macOS utility for converting fat-frameworks to SPM-compatible XCFramework with arm64-simulator support
Stars: ✭ 239 (+528.95%)
Mutual labels:  swift-package-manager, spm
concurrency-kit
🚄 Concurrency abstractions framework for Apple Platforms [Task, Atomic, Lock, Operation, etc.].
Stars: ✭ 17 (-55.26%)
Mutual labels:  swift-package-manager, spm
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (-31.58%)
Mutual labels:  swift-package-manager, swift5
Bettersegmentedcontrol
An easy to use, customizable replacement for UISegmentedControl & UISwitch.
Stars: ✭ 1,782 (+4589.47%)
Mutual labels:  swift-package-manager, swift5
Aksidemenu
Beautiful iOS side menu library with parallax effect. Written in Swift
Stars: ✭ 216 (+468.42%)
Mutual labels:  swift-package-manager, spm
Swift-FFDB
a Object/Relational Mapping (ORM) support to iOS and MacOS .Since SwiftFFDB is build on top of FMDB.
Stars: ✭ 22 (-42.11%)
Mutual labels:  swift-package-manager, swift5
SETabView
SETabView is a TabBar with simple yet beautiful animations that makes your apps look cool!
Stars: ✭ 53 (+39.47%)
Mutual labels:  swift-package-manager, swift5

Match3Kit

Library for simple Match3 games. It can work with a solid grid of figures and spill them only in columns.

Forest walk

Example

Create the enum for all kinds of figures:

typealias MyGrid = Grid<Shape>
typealias MyController = Controller<Shape, Generator<Shape>, Matcher<Shape>>

enum Shapes: String, GridFilling {
    case square
    case circle
    case triangle

    var pattern: Pattern {
        Pattern(indices: [])
    }
}

Create a grid controller with configurations:

let controller = MyController(
    size: Size(columns: 6, rows: 6),
    basic: [.square, .circle, .triangle],
    bonuse: [],
    obstacles: []
)

Create UI based on the grid that the controller generated:

for index in allIndices {
    let cell = controller.grid.cell(at: index)
    setupUI(for: cell, at: index)
}

Swap figures after the user interaction:

func swap(source: Index, target: Index) {
    if controller.canSwapCell(at: source, with: target) {
        swapUI(source, target)
        if controller.shouldSwapCell(at: source, with: target) {
            let indices = controller.swapAndMatchCell(at: source, with: target)
            let match = controller.match(indices: indices, swapIndices: [source, target], refill: .spill)
            remove(indices)
            spawn(match.spawned)
            spill(match.removed)
        } else {
            swapUI(source, target)
        }
    } 
}

Used in:

Forest walk

Forest walk

TODO:

  • Add more examples with bonuses
  • Add a demo project
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].