Skip to content

tonytins/act2

Repository files navigation

Act 2 🎬

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.

Installation

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.

Usage

    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)

Supported Versions

act2 Minimum Swift Version
main 6.0

License

I hereby waive this project's copyright and place it the public domain - see UNLICENSE for details.

About

Act 2 is a simple engine for making text-based adventure games using JSON.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages