Swiftpack.co - SwiftStudies/SKTiledKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by SwiftStudies.
SwiftStudies/SKTiledKit 0.7.0
A SpriteKit specialisation of TiledKit for Tiled
⭐️ 2
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/SwiftStudies/SKTiledKit.git", from: "0.7.0")

SKTiledKit

A Swift Package for reading Tiled levels that makes it easy to use with SpriteKit and provides a command line utility that provides (amongst other things) the ability to preview levels directly from Tiled. SKTiledKit is build on top of TiledKit a cross-platform Swift package for reading maps, tilesets and more.

Out of the box (with no specialisation for your particular game) the only code needed to load a level, playing animations would be

// The the map from the Maps folder of the app's bundle
let scene = try Project.default.retrieve(scene: "Level 1", in: "Maps")

// Configure and present the view
scene.scaleMode = .aspectFill
let view  = SKView(frame: scene.frame)
view.presentScene(scene)

You can find more information in the SKTIledKIt Documentation. You can actually explore this default behaviour using sktiled, a command line utility included in the package that can be configured as a command in tiled. Here's it running, note that debugging of SpriteKit physics objects is turned on so you can see the collision body for the bomb being trsrc="https://raw.github.com/SwiftStudies/SKTiledKit/main/ted into the generated SKSprite node.

Documentation

  • sk-tiled More documentation on the command line utility
  • Documentation All documentation on how different Tiled entities are used/interpretted

GitHub

link
Stars: 2
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics