Act 2 (or ActTwo) is a simple game engine for making text-based adventure games using JSON. This project is named after and fully backwards compatible with Dimitri Wayland's original Act game engine.
let package = Package(
// name, platforms, products, etc.
dependencies: [
// other dependencies
.package(url: "https://github.com/tonytins/act2.git", branch: "main"),
],
targets: [
.executableTarget(name: "<your-game>", dependencies: [
// other dependencies
.product(name: "ActTwo", package: "act2"),
]),
// other targets
]
)Or in Xcode: File -> Add Package Dependencies, then paste the repo URL.
let jsonData = Data(jsonFile.utf8)
let world = try! JSONDecoder().decode(GameWorld.self, from: jsonData)
let engine = try GameEngine(world: world, startRoomName: startRoom)
print(engine.currentRoom.scene)| act2 | Minimum Swift Version |
|---|---|
main |
6.0 |
I hereby waive this project's copyright and place it the public domain - see UNLICENSE for details.