× {{alert.msg}} Never ask again
Receive New Tutorials
GET IT FREE

First-time Indie Game Developers: Should You Pick Objective C?

– {{showDate(postTime)}}
Michael Paynter, indie gamedev
 Michael Paynter is a Codementor user and independent game developer working on his first iOS game. After more than a year and a half using Objective-C, he shares his experience with the platform and tools that made the difference while coding his first game.

If you had to pick again, would you still learn Objective-C as your first language?

Definitely. I know a lot of people fall in love with their first language, but that’s likely tied to the reason they chose to learn that language in the first place. I looked at Objective-C and the iOS platform and saw the tools I needed to create the game I wanted to make, one that could also appeal to a massive audience.

Jumping into Objective-C gave me a wealth of tools that made complex goals attainable, such as online multiplayer. ARC was there from the start to make my job easier, as well as built-in Xib/Storyboard files, and additional APIs such as Sprite Kit and Cocos2D.

What about multiplatform IDE’s, such as Xamarin?

When I decided to make a mobile game, multiplatform was obviously something I considered.

When I started looking into Xamarin, it seemed like a fantastic tool that was a bit beyond my skill level.

Publishing to more than one platform meant not only getting a single build up and going, but making sure it translated to the platforms it wasn’t natively built for. A basic understanding of the differences in the platforms would be crucial to get them stable. Add the fact that I was looking at making an online game, and it became clear I should start by learning one language before attempting more complex goals.

 I also liked the idea of focusing on a single platform. iOS and Android have become so established as gaming systems that we are starting to see a bit of platform exclusivity spill over from the console wars. Apple constantly advertises games that are exclusive to its platform, giving them large banner advertisements on the front of the App Store. My goal is to nab one of those spots for a forthcoming game.

What was the hardest part of learning the platform?

If we’re talking code-wise, I suppose it would be learning Game Center. Apple has done an amazing job, but it is still a complex operation, and since I was incorporating everything programmatically, it took some work to wrap my head around what was going on.

 It was also my first encounter with multithreading, which threw me for a loop at first. Like most things in coding, though, once you understand it you wonder why you ever had trouble with it.

 If you’re talking overall biggest challenge, though, I can talk about the problem that brought me to Codementor. When Sprite Kit was first released, I was adapting some code to its syntax, trying to get the new animation methods to behave like the previous ones I had been using. I couldn’t see that my new methods calculated position differently than the previous ones, which was causing my inconsistencies.

 I was still trying to figure out the right question to ask, so sites like StackOverflow couldn’t give me productive answers. I’m currently living in a town of around 5,000 people in southern Indiana, so it was difficult to find someone to ask for advice.

 Once a mentor started picking apart the code with me, we tracked down the source of my problem and found a solution. When I found Codementor, I finally found a way to get the one-on-one time i needed to help me understand and fix problems that were way too intricate for the likes of Google or other programming help sites.

What was your experience like using Sprite Kit?

Over the past year and a half, I have actually worked on a couple different games. My first game was built using plain Objective-C/Cocoa Touch. I was able to get a working Alpha of it up and running, but I knew that I wanted to eventually incorporate particle effects and physics to add a bit of “fireworks” when pieces on the board would explode.

I attempted a few things, but as a novice programmer, all my solutions caused the game to chug along at sub-30fps levels. Before I had a chance to dive into Cocos2D, Sprite Kit was released, and I decided to give that a try. Once I began using the advanced animation tools, I was hooked.

Sprite Kit is an engine for making 2D games, and it makes everyday tasks like moving objects around on the screen a breeze. Particle effects are as easy as making a custom particle class and tinkering with the settings, and for physics all it takes is a single line of code to activate. It truly has been a joy to use, and it will be interesting to see what the transition is like once I move to Swift.

What advice do you have for those looking to make their first game with Objective-C?

If you’re trying to save some time in development, see if it is possible for your artwork to be cohesive with the default Game Center view that’s provided. It has all the features available for you, and the only thing you have to do is worry about submitting high scores, achievements, and other information for it to operate.

 And if you’re making a 2D game, do yourself a favor and start out using Sprite Kit or Cocos2D. One important thing to know about these tools is that they have their own “Scenes” they run in on top of the default view, so any visual elements you have already implemented will likely have to be recoded. Luckily, any logic you have written will be nearly 100% compatible. Once you have your game up and running on one of these two API’s you will have access to almost every tool you could ask for to make the game of your dreams!


Want to learn Objective C and iOS development faster? Work with our expert mentors on Codementor!

View iOS Expert Mentors




Questions about this tutorial?  Get Live 1:1 help from iOS experts!
Ben Gottlieb
Ben Gottlieb
5.0
Senior iOS Developer
I've been in mobile since Apple's premier handheld was the Newton. I've worked on top grossing iOS apps, and consulted with companies large and...
Hire this Expert
Miral Gaywala
Miral Gaywala
5.0
Full Stack developer (React Native, Flutter, ReactJS , NodeJS, PHP, AWS)
I have been in this industry for 10+ years with consistent knowledge in developing mobile apps and website with expertise at: - React Native, -...
Hire this Expert