在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mchakravarty/HaskellSpriteKit开源软件地址(OpenSource Url):https://github.com/mchakravarty/HaskellSpriteKit开源编程语言(OpenSource Language):Haskell 95.3%开源软件介绍(OpenSource Introduction):Haskell binding to Apple's SpriteKit frameworkOpen source under BSD3 license. Contributions under the same license are most welcome. To build this project, you need a recent version of Xcode and GHC 8.0.2. If you don't want to build it yourself, a pre-compiled version comes with Haskell for Mac, which also provides the best Haskell SpriteKit development experience. This code has currently only been tested on macOS. The main obstacle to using it on iOS is lack of support for Template Haskell (and hence, The talk Haskell SpriteKit — A Purely Functional API for a Stateful Animation System & Physics Engine discusses the architecture of Haskell SpriteKit — see also the accompanying paper Haskell SpriteKit — Transforming an Imperative Object-oriented API into a Purely Functional One. An example game: ShadesHave a look at a clone of the mobile games Shades as a simple example to get you started: This implementation of Shades is explained in detail in the paper Haskell SpriteKit — Transforming an Imperative Object-oriented API into a Purely Functional One, which provides an overview of the design and internals of Haskell SpiteKit. Another example game: Lazy LambdaAs a second example of a simple game in Haskell SpriteKit, have a look at Lazy Lambda, a Flappy Bird clone: For an explanation of the main concepts of the Haskell SpriteKit binding including live coding of Lazy Lambda, watch the talk Playing with Graphics and Animations in Haskell (includes video and slides). Building with a stock GHC distributionUnfortunately, a quick and easy cabal or stack-based build is not possible. In addition to Haskell, this project includes Objective-C and Swift code, and neither cabal nor stack can handle this properly. The build requirements are as follows:
Open the project in Xcode and build or archive. In either case, the build procedure will install a fair few packages from Hackage into your user package database (see the To use,
The build system assumes that everything is going to be linked dynamically. An exampleIf you like to see concrete example code of how to build a standalone Mac app embedding a Haskell SpriteKit scene, check out the NB: The basic set up is similar to Haskell for Mac, and hence, suitable for distribution through the Mac App Store. Feature setFor details of the supported API, see the current Haddock documentation (currently version 0.9.0.0). Supported featuresThe Haskell binding supports the following SpriteKit node types:
Moreover, almost all SpriteKit animation actions ( Unsupported features
Most of the missing features can be supported quite easily by simply following the same approach as used in the existing code. (Just open an issue if you are looking for something specific. Or, if you can, implement it and open a pull request.) Moreover, this project needs a proper suite of unit tests. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论