MakeGamesWithUs Blog
Looking to convert your cocos2d game to the iPhone 5? Read on!
With the iPhone 5 (featuring Retina 4 and iOS 6 - are you confused yet?) we’re looking at a 640 x1136 resolution. All current apps are still backwards compatible - an 88 pixel wide black letterbox will be added at the top and bottom (or left and right for landscape) of old apps. Coordinates for cocos2d correspond to non-Retina pixels. So a sprite that is set at (1,1) in cocos2d coordinates is actually at (2,2) in terms of iPhone Retina pixels.
In cocos2D, the new game dimensions are 568 x 320 for landscape mode, the most common game orientation (setting a sprite to position 568, 320 will move it to the upper right corner).
Here are some tips on covering cocos2D iPhone games to the new resolution to avoid letter boxing. The examples assume your game is in the landscape orientation (flip the x-y coordinates if your game is in portrait):
0) Get Xcode 4.5.
1) New splash screen image:
Every app will need a Default-568h@2x.png file to avoid letter boxing. Just having this picture deactivates letter boxing - you’ll need to fill the space with your game, though. The file will need to be 640 x 1136 pixels. In Xcode’s issue navigator, Xcode offers to create a default image.
2) Changing in-game background and menu images:
There are several possible strategies:
-Use a larger centered background image for all iPhone models. The image will run off the screen at the left and right sides for older iPhone models.

-Use an if statement to detect the type of device and select one of two background images.
This simple if-statement should work:
CGSize winSize = [CCDirector sharedDirector].winSize;
if (winSize.width == 568) {//code }
//for landscape mode, in cocos2d coordinates
-Use a normal centered background image (960 x 640 pixels for retina). Then use two separate images to fill in the left and right sides if the device is not an iPhone 5.

For scrolling backgrounds, there are two possible solutions:
-The easiest (recommended) solution is to have a universal 1136 x 640 pixel background for all Retina devices, which loops when the screen is at multiples of position 1136, no matter which device is running.
-The complicated (not recommended) alternative is to lay out background images side by side. There will be at most three 960 x 640 pixel images on the screen at once. Initially, two images will be visible, side by side, with the second image filling the 176 pixel gap to the left or right of the first image. When only 176 pixels (88 cocos2d coordinates) of the first image are visible, a third image is added to the other end of this chain of images. When the first image falls off the viewing window, it is removed. The process repeats.
3) Altering positions of objects:
One method is to position objects relative to the window size, rather than positioning them with absolute coordinates.
-For UI elements, you can position objects at a slight offset from the screen edge. For example, instead of positioning a pause button at the upper right corner at 440, 280 as you would for iPhone <5, you can position the button 40 coordinates to the left of and 40 coordinates under the upper-right corner.
CGSize winSize = [CCDirector sharedDirector].winSize;
button.position = ccp (winSize.width - 40, winSize.height - 40);
//actual Retina pixels = 80

-For elements in the center of the screen (not UI elements), you can use a scaling factor for whichever coordinate varies between iPhone 4 and iPhone 5 (i.e. the x coordinate for the landscape orientation).
For example, if a sprite is normally positioned at (180, 200) for older versions of the iPhone, then what you first do is find the ratio of the old x-coordinate to the old screen width (in cocos2d coordinates). For example, 180/480 = 0.375. In other words, our sprite’s relative y position is 37.5% of the screen width.

Your new code would then look like this:
CGSize winSize = [CCDirector sharedDirector].winSize;
//only set this variable once in your method/class
sprite.position = ccp (winSize.width * 0.375, 200); //y-coords are unchanged
-If all else fails, you may have to manually set a different layout for the iPhone 5.
4) Wrong variable representation:
Problems will arise where you explicitly set a variable or property as 480 or 320, when what you actually mean is winSize.width or winSize.height. For example, this problem would arise if you want to set a sprite’s position to the corner of the screen, and set its position as (480, 320). That would need to be replaced with (winSize.width, winSize.height).
The reverse is sometimes true, where you use winSize.width/height when you mean 480 or 320 pixels. For example, this problem might crop up in a platformer game where you set the edge of the screen as winSize.width * 2 when you actually mean 960 pixels, which is the actual length of your in-game platform level.
5) Known bugs:
- Landscape mode is broken with iOS 6. The beta version of cocos2d, version 1.1, fixes the issue.
- One workaround for cocos2D 1.0.1 is replacing [window addSubview:viewController.view] with window.rootViewController = viewController in the application delegate.
- For cocos2D 2.0, the latest beta version, 2.1, fixes the issue and also contains iPhone 5 templates.
- For Kobold2D, the issue is fixed in the latest version.
Some of these tips were adapted from a great discussion here.
We won’t pretend to know how you will get into YCombinator. This is the story of how our company got in, extracting useful lessons is left as an exercise to the reader ;)
We started as two friends from high school who wanted to make games. We both took time off from college and moved in together in Boston in August 2011. We weren’t really part of the startup scene there, in fact we thought of ourselves more as an indie game studio. We went to Boston Post Mortem, a monthly game industry meetup, played games on Fridays at MIT’s Game Lab (yes, there is such a thing, and yes it’s awesome), and hung out with other indie game developers. We were working on a cool game called Realms at War.
And then the idea of applying to YC came along. We figured it was worth a try. Filling out the YC application was a transformative event for us. There are bigger businesses than making one cool game, and the application forced us to start thinking of them. We filled out the application over the course of a couple weeks. We hadn’t read a single ”How to get into YC” or “How we hacked YC” article beyond YC’s own guide. We pitched a marketplace for game developers to connect with artists and share revenues on a finished game instead of paying each other.
Ashu, my co-founder, had struggled with this in particular. He made his first game in high school, and it made over $30k on the App Store, but who knows how well it would have done with a professionally done icon and graphics? We had since matured as game developers and felt we had done a pretty good job with art and music in our games so far (Realms at War and WarSquared), so it was only natural to try and solve the ‘art+music for my game’ problem for others. We’ve since tweaked the idea – we now teach programmers how to make iPhone games, produce all the art and music for their games, and publish them. How we ended up there is a story for another time.
The time came to make our application video. It was past midnight, we had an early morning bus to Montreal and we simply couldn’t do a take without one of us making faces or cracking up.
In a sleepy stupor we decided to film the video in our ‘native’ accents and nailed it on our first take. We were in such a rush to sleep, pack, and catch our bus that we actually forgot to submit our application. The next day we submitted from a hostel in Montreal, clicking the submit button together, each with a hand on the trackpad ‘all for one, one for all’ style.
This was our application video:
From the Skype pre-interview to the in-person interview to the meet-and-greet reception after we got in, the only thing any YC partner remembered about us or our idea was “Oh! You’re the guys with the accents!”
We’ll never know if we got in because of our silly accent video. Was this how we ‘hacked’ the interview process? The magic bullet that got us in? Probably not. In fact it would be irresponsible of us to recommend you try it :)
Realistically, we’re probably part of a silent majority of YC companies who a) have solid and compatible founders, b) were clear and concise in their application, and c) have domain experience in the problem they are addressing. Coming across in the interview as being motivated, flexible and smart was the icing on the cake - the rest is history.
The summer after my junior year in high school my parents wanted me to get a job, but I convinced them I should write an iPhone game instead. I did it because writing games was a whole lot of fun, and I wanted to learn more computer science. I launched Helicopter to the app store, hoping to make back the $99 I paid to join the developer program. Instead, the game exploded at my high school, a few girls became Helicopter groupies (cute ones ;) and I made $35k. What more could a 16 year old want? When I read the first review of my game calling it “my favorite game ever” a fire was lit inside me. I had made something people wanted and put a smile on a stranger’s face. And so began the slippery slope that led me to drop out of college, found MakeGamesWithUs and go through Y Combinator at 19.
But this is not about me, this is about you. And about our company’s dreams of lighting that fire in whoever will bring us the kindling. We believe making an iPhone game is a fun and easy way to build a product, make money and make people all around the world just a little bit happier. And now that everyone has seen The Social Network, all your friends will think you are really really cool!!
This summer we hosted an internship for 40 high school and college kids (more on this in a later post). Every day these kids would arrive at our Palo Alto hacker house (Social Network style) at 10am, sit on a couch or at a desk, and hack away at their own iPhone games.

When we told people we were doing this, the typical response involved 3 questions:
“Do you mean 4 interns?”
“No 40”
“Are you crazy?”
“Well sure, but not because of this”
“How do you keep them all on task?”
While running an internship for 40 people had it’s fair share of challenges, motivating the kids and keeping them focused was not one of them. Overloaded WiFi routers, neighbors complaining about blocked driveways and ever growing piles of trashbags, but no issues keeping our fledgling game developers focused. It became more and more obvious with every 11pm help email (“what’s a SIGABRT??” or “how do I add in app purchases”) I received that these kids were thrilled that they had an opportunity to build a game. Just as I felt when I was 16, there was nothing more fun in the world.
To most people, the idea of making a game seems pretty neat. At the end you’ll have a cool game to show off to your friends, and you can make money. But as our interns found out this summer, the process itself is even more remarkable than the end product. Everyone has different highlights of the experience, here are my top 3: 1. The self-driven learning of both programming and game design. 2. The consistent frustration and subsequent endorphin release during the building/creation phase. 3. The satisfaction and confidence instilled by completing the game.
If you ask any entreprenuer, or maker, or artist, the journey of taking an idea and pouring your heart out to complete it and then sharing it with the world provides you with a unique sense of fullfilment. Yet we are not exposed to it through traditional education, and only the fortunate are exposed to it through our work.
You owe it to yourself - there has never before been an easier way to take an idea, turn it into a product, and have it reach people all around the world. Come MakeGamesWithUs and discover (or rediscover) that satisfaction!
A job applicant to our company eloquently said: “12 year old me is threatening a time-travel-ass-kicking if I don’t push to join your team”. Ladies and Gents, 12 year old you is going to open a can of time travel whoop ass if you don’t get started on your iPhone game stat. (I’m looking at you Paul Buchheit)
MakeGamesWith.Us is a one stop shop for the aspiring iOS game developer. If you know how to program, we’ll teach you Objective-C, help you develop awesome iOS games, produce art/music for your game, and publish it.
Who’s “we”? Meet the team!
Ashu Desai, co-founder

Ashu has lived in 3 countries and visited 30, but thinks the Bay Area is the best place on earth. He enjoys building things and started developing iPhone Games when he was 16. He loves playing and watching sports, mostly NFL (Go Giants!). Through a mysterious series of events, he is currently driving a Mustang convertible rental car. It is an incredibly fun way to spend his last week as a teenager. Ashu is happy.
Jeremy Rossmann, co-founder

As MakeGamesWithUs’s in-house Frenchie, Jeremy is still unconvinced of the appeal of his co-founder’s favorite sport. He wrote the tutorials that have already turned dozens of high school students into awesome iOS game developers. If high school students can do it, you can too! He’s now sprucing up our website getting it ready to move out of beta and making sure that every game we launch gets the promotion and attention it deserves.
Brian Chu, intern extraordinaire turned lead developer

Brian came straight out of high school and interned with us this summer. He was awesome. Before we could pop the question, he asked, “Can I get a job here?” and the rest is history - company history. He claims he’s taking a year off before heading off to college, but we’ll be sure to show him the startup light. Brian is our dedicated in-house developer, helping the MakeGamesWithUs community with their questions, building amazing game templates, constantly updating our tutorials, transforming good games into great games for release, and… we’ll just stop there. When he’s not talking on his Android smartphone, using CVS for version control, writing side projects in Java, booting up Windows, and… wait a minute… You can check out the shining pinnacle of minimalistic simplicity that is his website, brianchu.com. Stay tuned for his awesome iPhone game, Devils in Heaven, to be released soon!
Andrew Slaughter, game producer

Andrew grew up in Louisiana restaurants and once owned an ice cream truck in Hawaii. If he’s not pushing pixels, he’s probably surfing. Artist. Mechanic. Old-school gamer. Burner. Somewhere along the road he felt like he should move to California and is now managing the art process for all of our games. twitter@Drizzzler