Link to home
Start Free TrialLog in
Avatar of Mr_Fulano
Mr_FulanoFlag for United States of America

asked on

Which platform to use...?

Hi, I'd like to program an iPhone game. Nothing earth shattering, just a simple 2D game to learn how its done and have fun. I'm not sure what the game is going to do yet, as I'm still researching the coding aspect of the game first.

I've been looking at Flash ActionScript3 and at Cocos2D. -- The question is...which is better? I understand that one is a bit more code intensive than the other as Cocos2D uses the Objective-C framework, and ActionScript3 is actually not too hard to code, but in the end, which will produce a better game?

I'm going under the assumption that both are equally capable of producing a 2D game for the iPhone. I'm also going to go out on a limb and assume that both are equally as memory intensive - perhaps that's a wrong assumption to make. If so, please explain.

What are the pros and cons of one vs. the other? Which would you (or do you) use and why?

Thanks,
Fulano
Avatar of Anwar Saiah
Anwar Saiah

To my knowledge Adobe Flash has an issue with iphones, although it is a very strong and stable tool, in my opinion!
Avatar of Mr_Fulano

ASKER

Do you know what the issue is? Any details I can follow-up  on?

Thanks,
Fulano
Actionscript will be slower and less efficient than either Cocos or Objective-C, but for a simple game thats probably not much of a problem.  Cocos is a game engine built for iOS in Objective-C, Actionscript runs in a VM.   However, ActionScript will port to Android devices and almost anything else.  Apple has never been friendly with Adobe and took legal action to stop Flash on iOS, however Adobe have found away around that.

If you know C or C++ you might consider using Objective-C only as a link to the OS and writing the game in one of those languages.  Apple provides basic app code that would make this very easy.  Some people take the same approach with Android and Java.  iOS has a few ways of drawing the display, Quartz and OpenGL being the most useful for games.  Its a steeper learning curve in terms of game coding, you wouldn't have to learn a new language.

On a personal note, I detest ActionScript3 as a language.  I find it anal to the point of being useless, even worse than Java.  A language that forces you to waste days while porting a game from another language.  However, many programmers seem happy enough with it.  ActionScript2 was a better language IMO but the AS3 system is better organised.
Wow..."detest" is harsh. I'm beginning to agree with you that Cocos2D may be the way to go, as I've been doing a lot of research and from what I've read, ActionScript 3 seems to not be the highest performance output available.

I didn't want to invest any more time into AS3 and then find out that its a performance hog and that my games don't work well. However, I wasn't too sure if Cocos2d was the way to go.

Thanks for your suggestions.
Fulano
I guess it is harsh, never has a language given me so much trouble and I have used many languages.

I tried to port a game to AS3, spent days of splitting up source files into lots of much smaller source files and then putting package around each tiny source file, labelling everything specifically with every one of its attributes, having it 'warn' me that it was applying a default that it was supposed to apply.  I got some way in then gave up in frustration with it giving me a message about something being not defined when it was in the same source file.  This was a game that was complete, fast and bug free in two other languages.

I prefer languages that allow a program to develop, for the structure and design to evolve.  You only have to write the code that is needed and you can run a program even if you haven't designed every last detail yet.  But failing, I prefer a language that allows a working program to work.  AS3 is the exact opposite, everything must be in the 'correct', and the language designer's definition of correct appears to be Java but less flexible.
Uh, "detesting" a language for it's strong points it's quite odd. Yes, it's strong typed, yes it's strict, yes it's totally OO, but so are a lot of other languages. If you've coded with C#, you'll find similarities (strict). It's basically a quite strict version of ECMAScript, can be quite fast depending on your target (mostly PC), can be used for RIAs (Flex), etc. However, if it ain't your cup of tea, it ain't your cup of tea... just don't go saying it's a "useless" language. It isn't.

Anyway, back to Mr. Fulano's question, I guess it boils down to experience. If you've used Objective-C before go ahead and do it on Cocos. If you've coded on say JavaScript and are comfortable with it, you could give it a shot with AS3. However if you don't know any of this, it's down to learning something new, Objective-C although influenced by, isn't that similar to C, it's taming a new beast if you may. Same goes with AS3, very similar to JavaScript but with it's own peculiarities.

If you do know both, go with Cocos. Native coding on iDevices is fast, and using 3rd parties (Rhomobile, AS3) can't keep up with it performance-wise.

Good luck!

-V
That wasn't my point.  It's not strong typing, strictness or OO that is the problem with AS3, I don't mention those things in my reasons, I like C# and C++.  I find the language enforces structure and verbosity on the programmer than has nothing to do with the program.  Structure for it's own sake, because the designers considered that 'proper'.

As I say, lots of programmers like AS3 and no doubt they have produced well functioning programs with it.  I find it painful to use, Mr_Fulano will have his own opinion on the matter.
Hi friends, my questions was actually more geared towards, performance and producing a game that works well on the iOS platform. I've done a little Objective-C programming and find it to be a little like eating broccoli...at first I hated it. However, over time, I acquired a taste for it and now actually like it. At first, I hated the square brackets and the fact that I couldn't pass my methods with a dot syntax. However, over time, I got used to it and find that passing methods is actually not as difficult as I once thought.

That said, I also like AS3. I found it to be a bit oddly structured, but got used to it and really liked the marriage between graphics and the back-end code.

All-in-all, I'm beginning to find more and more testimonials stating that Cocos2D is actually a better performer than AS3, at least for iOS purposes. I'm actually a bit disappointed, because Cocos doesn't have the graphics engine that AS3 has, but the performance boost is a major factor for me to consider.

Thanks you all for your input. I think this was (and still can be) a very positive discussion into the merits of one platform vs. another in terms of its strengths and weaknesses.

Thanks,
Fulano
Yeah man, thanks.
You should also know that Adobe has fired some 250 imployees of it's staff, and stopped supporting a lot of platforms running flash! So this can also mean something towards avoiding AS3.

Although it wouldn't so much matter for the near future, but still I don't think you'll like the idea of swtiching platforms all the time.

Have fun!
Hi Aboo_s, thanks for the info on Adobe. I did not know that although its not a surprise. Our US economy is in serious shape with over 14M unemployed in our country and nothing is being done to create jobs - however, that's a totally different matter and one that is pointless to get into...so much for Hope and Change - right...lets not go there!

Thanks for the news regarding Adobe, that does make a difference to me as I pick the most appropriate platform for my task.

Thanks again,
Fulano
ASKER CERTIFIED SOLUTION
Avatar of Member_2_5069294
Member_2_5069294

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Satsumo, you've provided a lot of very good information and have helped me make my decision. I'm going with Objective-C and Cocoa2D.

Thanks,
Fulano
Thanks for your help!