Playing with SpriteKit in a Swift Playground - Update
/Time to update my Swift SpriteKit Playground example... now with added SpaceCats!
Read MoreAt WWDC 2014 Apple introduced a new programming language, Swift. At this point everyone has exactly zero days experience in Swift. This blog will capture and share our learning, and I hope the learnings of others as we go.
Time to update my Swift SpriteKit Playground example... now with added SpaceCats!
Read MoreIn the last article we looked at providing a better (and purely Swift) implementation of GameplayKit's Entity/Component architecture. By better I didn't mean "it's Swift so it's better"... I meant better at solving the stated objectives of GameplayKit: Rendering framework independence and composition. I focused on composition last time, this time I look at how the Swift GameplayKit implementation (and Swift itself) makes rendering framework independence easy.
Read MoreiOS 9 and OS X El Capitan strengthen Apple's gaming line up with GameplayKit, which augments the graphics (and physics) engines with a game engine. Over the coming weeks I'm going to walk through the process of developing a "bomber man" style game using SpriteKit and GameplayKit.
The code will be supplied in a playground that will have a page for each blog entry. In general, I'll discuss concepts in the blog, and leave explanations of specific pieces of code in comments or Playground markup. There's going to be a lot to cover, so let's get started.
Read MoreOptionSetType is a protocol that intends to modernise the methodologies used for single variable option masks. Traditionally this has been done with bit masks, and lots of logical &s and |s and replaces them with explicit set syntax, with appropriate methods for checking and combining OptionSets
Read MoreLike many of the new Swift 2.0 features introduced at WWDC, guard is capable of supporting many useful patterns not all of them immediately obvious. The very verb "guard" makes us think about protection, but it can be much more broadly used than that.
Read MoreOne of Swift 2's most exciting additions are protocol extensions. These allow you to add new methods to anything that implements a protocol. I thought it might be interesting to explore this with a practical example, generating random or repeating sequences from any collection.
Read MoreSwift 2.0 has introduced (amongst many other things) a new defer keyword which enables a much clearer expression of intent than was possible in Swift before.
Read MoreMake the Swift 2.2 to 3.0 transition a little easier with these useful regular expressions for XCode
Time to update my Swift SpriteKit Playground example... now with added SpaceCats!
Even a simple text adventure contains all of the fundamentals of lexers, parsers, and interpreters. Using STLR to define the grammar, and its Swift code generation, we quickly create a simple adventure game in Swift.