(c) 2020 Max Goren via/ MIT License (see LICENSE)
a wrapper for calling functions from the Doryen Library (libtcod) natively in Swift 4.2
- libtcod version 1.16 alpha
- macOS 10.13.6
- XCode 10.1
- Swift 4.2
-contains classes to call from your main.swift to use the functions
and types available in libtcod
-tells Xcode to look in the libtcod headerfiles through its object-c bridge.
-libtcod - available at https://github.com/libtcod/libtcod
import Foundation
let title = "my swift tcod project"
let tcod = TCOD()
let width: Int32 = 80
let height: Int32 = 50
tcod.initRoot(w: width, h: height, title: title)
tcod.clearConsole()
tcod.flush()
tcod.printStr(x: 5, y: 5, str: "Hello, World!")
while ( !tcod.windowisClosed() ) {
if (tcod.chkKeypress()) {
tcod.printStr(x: 5, y: 7, str: "Hello, Again!")
}
tcod.flush()
}
tcod.quit()
exit(0)