A tale about Swift and SpriteKit

Ernesto Torres
Indie Game Devlogs
Published in
3 min readJun 5, 2017

This a game development meets iOS development post.

I spent about 3–4 years making games as a hobby. Made many small games thanks to game jams like: Ludum Dare, JS13k games, among others. At some point even made a “larger” game that is available in the app store for free. (Mammoth Monkey Mole is a puzzle game made entirely in SpriteKit and Swift. )

At that time I didn’t want to learn Unity3d which was not as friendy for 2D games as it is now. Neither I wanted to make a Javascript web wrapper or use another cross-platform game engine. As an iOS developer I thought I could release faster by using tools I already knew. I was already familiar with Xcode and Obj-c, I just had to learn SpriteKit.

Close to that time Swift was released. Made a decision to leverage my interest in game development together with learning a new language. Dropped all my work and started to build again from scratch and started with Swift 1.0.

It is worth mentioning that the idea and concept of the game was already completed. Most of the gameplay was done, and some levels were completed. And the original version was made and released in just 3 days for a game jam (LudumDare 30 August 22nd-25th, 2014). All was left was port it to iOS, update graphics and music. Sounded pretty straightforward, even if I was making this in my free time since I had a 9–5 job already.

The first commit on the repo was made: September 23, 2014 at 8:52:52 PM CDT. The commit description: First version.

One of the things I like of version control is that it tells a story:

  • October 29, 2014 at 12:07:18 AM CDT: Moving rocks with Mammoth
  • October 29, 2014 at 10:45:36 AM CDT: Changes for Xcode 6.1. Added Hole item. (<- Swift 1.1 migration)
  • October 31, 2014 at 1:25:49 AM CDT: Fix for a crash in iOS 7. (Some comments in the code: //In iOS 7 the casting is not working, so texture is not changed. Seek for workaround)
  • November 20, 2014 at 3:20:10 PM CST: Removed movement layer, was causing issues in iOS 7 (More Swift/SpriteKit issues)
  • March 14, 2015 at 10:56:37 PM CDT: Added logo for launch screen. (Started looking like a real game)
  • April 6, 2015 at 9:37:44 PM CDT: Added level 1–5 (Most pieces were completed, time to add content!)
  • April 30, 2015 at 8:49:40 PM CDT: Updating to swift 1.2 (Another update!? oh no!)
  • May 10, 2015 at 8:09:17 PM CDT: 1.0.0.1 (First stable version!)
  • May 21, 2015 at 9:42:33 PM CDT: 1.0.0.2 (Some bug fixes and improvements)
  • May 31, 2015 at 7:14:19 PM CDT: Locking levels. Release 1.0.0 (To the App Store we go!)
  • July 4, 2015 at 3:55:11 PM CDT: Prepare for App Store release (Second big update, the first release only supported iPad but not iPhone)
  • January 27, 2016 at 8:23:15 PM CST: First pass to Swift 2 (More upgrades!?)

After the last one there is just one more commit to fix some warnings.

Originaly Mammoth Monkey Mole was a paid app, but made exactly: $0.00

I was disappointed. After all, I made a huge time investment. It had several iterations of graphics, paid from my pocket for the music and everything was coded to work as perfect as possible. Finally, decided to give it away for free.

Even if I didn’t make any money, I did learn a lot of things:

  • The competition in the App Store is fierce. It is hard to be visible unless you also invest money to make you visible.
  • I was able to see the evolution of Swift and experience all the improvements.
  • Did a lot of Swift migrations, so Swift 3.0 migration was not a huge deal. And had to do them without any migration tool.
  • Learned SpriteKit.
  • Learned Swift. (Thanks to this game I learned 1.0, 1.1, 2.0, 2.1, 2.2, and kept learning 2.3, 3.0, 3.1)
  • Learned to use Sketch. (Made all the graphics myself)
  • Watched a game evolve from concept to release.
  • The last 10% of the game development does take 90% of the time.

--

--

Ernesto Torres
Indie Game Devlogs

Software developer, Game maker and sometimes Artist. My opinions are my own.