Tag Archives: game development

SpriteKit > Cocos2d-JS

For the past few months I have been doing almost no developing since finishing Space Hops. I have been busy with school and other commitments but now that school is finally out I am just about to get into my next game (I am deciding to leave Space Hops as is, more on that in a later post). I had been debating between using a couple different game engines. I was  ready to start with cocos2d-js and I even developed a very basic game with it. cocos2d-js is great because you can develop for html5, ios and andriod, using the same source code. It also makes testing quick and easy because you can test it in your web browser. I was worried however about developing for different Android phones, and for the Android platform in general. During WWDC 2013 Apple unveiled it’s new game engine SpriteKit. The introductory videos that took place at the WWDC are very clear and the demo game Adventure they released demonstrates many of the things that SpriteKit is capable of. SpriteKit is native to iOS and OSX, and integrated with XCode 5. It comes with a built in physics engine and a particle effects designer! Apple have released a good deal of documentation to go along with SpriteKit, which is much better than the few sample games that are available with cocos2d-js to learn off of. I am quite devoted to my Apple devices, and I think iOS 7 is going in the right direction (maybe with a couple design changes: http://tristanedwards.me/what-ios7-should-look-likehttp://mattgemmell.com/2013/06/12/ios-7/http://josh.io/a-few-pixels-here-and-there-and-ios-7-is-beautiful/). I am convinced me to use SpriteKit as my game engine and develop solely for iOS and possibly OSX. I think it will be easier to transition to, and faster to develop with. I suspect that this is exactly what Apple had hoped to happen with SpriteKit. Apple knows that developers (mostly) prefer developing for iOS, due to the simplicity and greater revenues, and SpriteKit is an attempt to rip developers away from Android, and increase the amount of apps that are for iOS only. The only way I see this plan being really successful for Apple is if they release a great new phone in the fall to go with iOS 7. 

I have just begun working on my next game. I hope to share some of my progress along the way and hopefully be ready to release it in the fall. 


Space Hops Available!

Space Hops is now available on the app store! This is the first game I ever programmed, and the first iPhone app I ever made, so it would be awesome if you could check it out. I would be really grateful for some feedback! Hope you enjoy!


Beginning cocos2d

Here are some of the resources I found most helpful in developing my first cocos2d game.

While I wouldn’t have been able to make my first game without all these great resources, the best and only way to learn, in my opinion, is to make something.



The Cocos2d for iPhone Documentation is a great place to start. They have a clear programming guide to learn the basics and links to quite a few example games made with cocos2d.






RW-tiff Ray Wenderlich’s blog has some of the most thorough and informative tutorialsyou can find on cocos2d, along with a wide range of other topics. With new tutorials each week, there is a lot to learn. Here are some of the tutorials that I found most useful: 



Stackoverflow has a huge amount of resources for when things go wrong, or you don’t know how to do something. While occasionally you need to ask your own question, most likely your question has already been asked, and someone has given a clear, helpful answer.

One of the things that I wasn’t prepared for in starting game development was the amount of time you needed to devout to creating game art. While in hindsight it seems fairly obvious, when I started it didn’t really occur to me, I was ready for just coding, coding, coding.



While I would recommend trying to make your own assets, you might want to take a look at OpenGameArt.org first, as there are lots of great, copyright free, game assets that might be right for your game.



Gimp is a very powerful image editing tool. I used it to create all the art for my first game. Best of all, it’s free!






Pixelmator is another very powerful editing tool. I find it is a lot more visually appealing, and nicer to use than Gimp, but is is $30. Here is a good comparison of Pixelmator, Gimp and PhotoShop.





TexturePacker is very useful for creating SpriteSheets. It is very easy to use, and can even work with XCode, so that you don’t always need to delete and re-add your assets to your project each time you change your SpriteSheet. It is about $30 though.



iDeveloper Icon Generator is a simple program available on the Mac App Store that lets you upload one large icon for your game, and it generates all the other sizes that you require. While it is not essential, it is nice to have. It cost about $4.99.

Here are some other programs that I have not yet tried but I want to.


Particle Designer allows you to make your own particle effects, that work in cocos2d.





Glyph Designer allows you to create your own bitmap fonts to use in your games.



Below are two sample projects that I found most helpful, both you can also find on the app store:

The story behind Space Hops

I wanted to write a post about developing my first game, Space Hops. I also realized that it is not entirely clear, based on the screenshots, how Space Hops works.

To begin, this is the first game I have ever programmed. I began learning about iPhone app programming when I purchased my first Mac this August (‘the grass is always greener on the other side…’, I finally converted).  I originally started with the course CS193 on iTunesU by Stanford University, but I decided I was more interested in game programming so looked elsewhere. It did provide me with a good idea of MVC and other things you need to keep when developing for the iPhone. I found cocos2d and decided it was a good place to start. It seemed to have plenty of learning resources available with a learning curve that is not too steep, but yet capable of making more complex games.

I went through a lot of tutorials Ray Wenderlich’s on website. Funnily enough I really struggled finding an idea for my first game. I wanted something unique, but a game wasn’t so complicated that I would get half-way through and realize there were many more complexities than I had originally planned for. I was most inspired by the simple game Fall Down as I remembering being addicted to it, despite it’s simplicity. I also liked Doodle Jump, which Space Hops turned out being more like.

In Space Hops the platforms move down the screen. There are four different types of platforms, all fall at the same speed, but move across the screen (x direction) at different speeds and directions. The character walks side to side on the platforms (based on the accelerometer), taps when you touch the screen, and gets one boost per jump when you tap again. One some of the platforms there are coins. Each coin gives you a bonus 100 points and adds one to your multiplier. As soon as you let one coin go off screen, your multiplier resets. There are also asteroids which you have to avoid.

One of the hardest parts of the game for me was trying to get the platforms to fall at the right speeds so that they started off the screen, and came across where I wanted them to. It also took a lot of tweaking to get the the amount by which the x and y values speed up for each type of platform to keep the platforms moving (relatively) the same way across the screen. It also took a lot of effort to get new platforms spawning correctly. Beyond that I found getting the walking animation working pretty difficult too, but could never find a good way to adjust it to the speed at which he was moving across the screen. As a result sometimes he looks like he sliding… but he’s in space so that’s okay.

Among the most difficult aspects, not at all related to the gameplay, was trying to get iAd’s into the Highscore screen. I originally tried AdWhirl, but it gave me so many problems I was forced to give up. It took a lot of research to find a method that works well with cocos2d v2.0, as most are for older versions of cocos2d. I will hopefully be posting a tutorial on this soon.

I added the following power ups:

  • Half Gravity
  • Double Gravity
  • 2x Multiplier
  • 3x Multiplier
  • 4x Multiplier
  • Coin Magnet
  • Jetpack
  • Infinite side scrolling
  • Extra Life

Programming Space Hops was a great learning experience, and a lot of fun. I am very excited to get started on my next. Just need to get ready for some programming competitions first.

I hope doing tutorials and posting source code on how to make most of the game. I found one of the best ways of learning for me was by watching how other games were made. Hopefully it passes it’s iTunes Review, and is available soon. Hope you enjoy it.



Space Hops

Here are the screenshots of my new game Space Hops! Should hit the app store soon.



This is the first game that I programmed. I hope you like it!


iPhone App Progression

I am hopefully going to upload my first iPhone app to the app store tomorrow! As I was getting the screenshots prepared I found lots of older screenshots that I had taken while developing the app, and I found the progression pretty interesting.

Here are some of the first sketchs to just about the finished project.



The first character sketch.



This first background image.



I used to have carrots as ‘space food’ that you needed to eat in order to stay alive, the idea didn’t last too long.


The next four are just about the finished product, with new background image, character design, asteroids, power ups, game display, bonus scores, and main menu screen (don’t worry they move, they aren’t just misaligned).





You will hopefully be able to find Space Hops in the app store next week. I will be making more blog posts soon.