Four Corners: the first game in Catalog written in Swift

Four Corners: the first game in Catalog written in Swift

August 26, 2025

The Playdate game Four Corners, by prolific developer Scenic Route Software, has been rewritten in Swift—the first game in Catalog to be made using this new and burgeoning programming language.

Four Corners game key art

Here’s an interview with the developer Steven Chipman, digging into his decision to try Swift, and his experience with the project.

How was Four Corners originally written?

With the Lua SDK, released on Itch in December of 2022. Its first release was as an iOS game written in Objective-C around 2012. I’d worked on established iOS apps prior to it, but Four Corners was the first thing I’d made from scratch for iOS. To go even further back, the original concept for the game was written in Javascript in 2005.

Why did you decide to rewrite it in Swift?

I was very excited when the Swift team first announced that they’d gotten embedded Swift to run on Playdate. My day job is working on iOS apps, so I’m already very familiar with Swift. I think it’s a really nice programming language with a lot of great features. I was optimistic that any somewhat demanding game written in Swift for Playdate might perform better than it would with Lua, much the same way that C games can perform better than Lua games since they both compile to machine code rather than interpreted bytecode.

I had been spinning my wheels on two game ideas that weren’t going anywhere, and finding myself in-between projects I decided that I should finally give this a serious look. Re-writing an existing game seemed like the best way to get started with Swift on the Playdate, so this was generally an academic exercise to see if my assumptions about performance panned out, and if it would prove to be a viable alternative to Lua for future endeavors.

Among all of my games, Four Corners and YGMTB are the ones that would benefit most from any performance gains. Four Corners is much less complex than YGMTB, and had some slow-downs I’d never managed to solve despite my best efforts, so that’s the one I chose!

What was that process like?

A lot smoother than I was expecting it to be! I initially thought I’d get hung up in the dark recesses of Xcode dealing with build configurations and other arcana, but the PlaydateKit folks (the library that provides wrappers to the C API) have a template with all of that addressed, so getting up and running was really easy.

Installing the Swift tool chain required for embedded Swift was straightforward, and there’s several demos in the repository that were extremely helpful to have as references. Huge thanks to the folks behind PlaydateKit - this wouldn’t have happened without their work.

PlaydateKit has pretty complete coverage of the C API, but I was surprised to learn how many gaps there are in the C API compared to Lua. There are no animator, timer or datastore APIs, so I had to write my own. That was fun to do, but no different than what folks writing games in C have had to do, of course.

Largely it was having Nova and Xcode open at the same time and translating a Lua class to Swift. I started from the bottom-up, doing sprite subclasses first, and then the game logic. I had something playable within a day or two!

Would you write your next Playdate game (or three) in Swift?

That’s now the plan! I’ve written a bunch of Playdate games with Lua so I have a lot of re-usable components that I’ve carried over from game to game which makes it a lot easier to get things off the ground when you don’t have to make everything from scratch. Four Corners uses a lot of those, so they’ve been translated to Swift so that applies here now as well.

Four Corners game, Lua vs Swift

Are there Playdate projects you think Swift is particularly well suited for?

Since Swift compiles to machine code, you get C level (or at least very close) performance out of it. Any game that is particularly demanding that you would typically want to write in C could probably be achieved with Swift.

Or, if you just want to make a game in a language with more features than Lua, but is much more user friendly than C, it’s a great choice.

There are some caveats, which I’ll discuss in a bit, but I don’t think the inconveniences outweigh the performance of the compiled binary and the added benefits of Swift’s features.

Any words of advice for others looking to try Swift for Playdate?

Be prepared to do some things the long way around! Embedded Swift doesn’t have Foundation, so things we take for granted like trimmingCharacters(in: CharacterSet) are not available. Nor are weak or unowned references, so avoiding retain cycles is tricky.

The Codable protocol is also not available, which presents challenges for working with JSON. The C API does have a JSON API, but it’s much more manual to work with. I found it a bit daunting and ended up bypassing it all together and saving game state and preferences as binary files instead.

As far as I can tell breakpoints don’t work with Xcode and Playdate, which makes debugging difficult. If the game hits a runtime error, the simulator crashes without a stack trace which can be frustrating and challenging to track down. If anyone knows how to get that working, let me know!

Some PlaydateKit wrappers return C pointers, which I’ve never worked with before. All of those UnsafeBufferPointers and OpaquePointers made me squeamish and it took me a little while to figure out how to get to the underlying sprites returned by Sprite.overlappingSprites, for example.

PlaydateKit code screenshot

I don’t think there are many folks working with Swift for Playdate yet - I believe this is the third published thing? As far as I’m aware, Trophy Case was the first, and then XKPD. But there is the #dev-swift channel in the Playdate Squad Discord where folks can ask questions, so definitely hop in there!

What’s next for you, generally?

The original version of Four Corners I mentioned was a casualty of the 32 to 64 bit switch that happened when iOS 11 came out, and it was too difficult to update because the openGL framework it used had suffered the same fate. I really liked that version of the game a lot and miss it.

A lot of what I’ve done here - view models, game logic, that sort of thing - isn’t Playdate specific, so I’ve decided to resurrect the iOS game since it’s already halfway there. Keep an eye out for it this fall!

(Fun aside: During the most recent solar eclipse, I was looking everywhere for the glasses I’d bought for the family for the previous eclipse. I never found them, but I did find my old iPhone 5 that was running iOS 10 and had the original Four Corners on it!)

Thanks to:

  • The folks behind PlaydateKit
  • The Embedded Swift Team
  • Gurtt and PaulStraw for trailblazing this with Trophy Case and XKPD and answering my questions in the #dev-swift channel.
Four Corners in Playdate Catalog