Thursday, December 1, 2011

Marmalade #4 - Pc to Mac to iPhone!

I that title sounds ridiculous, or at least it does to my ears (eyes?).

However it is in fact a true explanation of what i did yesterday, or was it the day before. Well anyway, the facts are still the same.

Cross platform development is the single biggest reason i went looking for an SDK to do this job. As coding all the separate systems manually is a very large task. Obviously i have chosen the Marmalade SDK as it covers so many platforms and also I can write in C++.

Now my game, although not finished in the PC simulator (where i code the game primarily) was looking pretty good. So along with a friend of mine we decided it was time to see if we could get the game over to his iPhone (i don't own one yet). This blog post is about what happened.

1. My friend Paul set up his Mac with Marmalade and also after some trials and tribulations got it to put one of the hello world samples onto his iPhone.

2. Paul arrived with his Mac in hand and i copied my whole project directory onto a thumb drive and we copied it onto that Macbook. Then he decided we should compile it if it will and just see what happens. Well shockingly the whole thing compiled (apart from a typo from me). Then we got even braver and ran the compiled code. Once again we were Shocked to see the Mac simulator running the game on the Mac, mere minutes after copying it over. At this point we were very HAPPY with this SDK.

3. Next we were going to attempt what we really want to work. Can we get this onto an iPhone. Paul connected it up and a few minutes later we were once again shocked and exhilerated to see the game running onto theiPhone 4. We then followed that up by running it on the iPhone 3G. Ok, so i should point out here that the game at that time did not handle different screen resolutions and it does not properly handle the diferent processor speeds. BUT Oh My Goodness. Within 15 minutes or less, we had the game running on an iPhone.

THIS is what cross platform development should be like. though as you can tell we have had various milage before out of such cross platform sdk claims. This has to be one of the smoothest. In fact it was smoother than the Xna windows versions of my games to the Xbox versions. which is an amazing thing to say, as they were pretty straight forward.

Needless to say, this whole episode has inspired me to code more than i expected and i now handle different screen resolutions and also a bunch of other features have turned up in the game overnight, haha. I only have one issue remaining and that is....

4. In todays test the function to get the screen resolution returns a Zero on the iPhone, so the game defaults to a conservative 480x320 mode on the iPhone. Hopefully there is a cure for this as my re-scaling code is all in, it only neds to know the dimensions of the screen to work.

Both Paul and myself are very happy with the way this conversion is going. The only thing that concerns me at the moment is the thought of having to actually go Pay for the excellent Marmalde SDK, as we will need to buy two copies  :O  Pity i cannot get them on payback from ads or something haha.

Super Summary:
As per the title of this post. We did in fact go from PC to Mac to iPhone (and iPad), within minutes. YAY!

Da Voodoocheif

No comments:

Post a Comment