Port Flash to iPhone - iphone

How hard would it be to port a flash game to the iPhone. Obviously Flash CS5 is no longer an options, I still would like to know if there's anything that can be reused? or do I have to write everything from scratch (Is Obj-C that different than ActionScript?) Is there any other shortcuts?
Also, if anyone has done this before please share your experience.

Flash is a very different platform, not only is the language change going to be an issue you're going to be going from Flash's renderer to presumably your own using OpenGL:ES.
Although another method may be to port your app to JavaScript. Both ActionScript and JavaScript are EMCAScript dialects, so very similar in that area, the APIs will be completely different though.
http://paulirish.com/work/gordon/demos/ interesting and slightly related, this is a implementation of Flash in JavaScript.
Note the new Apple T.O.S may affect you, but as far as I'm aware it's still a beta and I'm not Apple or a lawyer so I won't try and decipher it for you.

I am doing the same thing. I am using Cocos2d for iPhone. This is a pretty good 2d game engine. Actually, two apps created with it are in the current top 25. You are going to have to get down and dirty in Objective-C though. Objective-C is different from ActionScript but if you are use to object oriented programming you should be able to make the switch. Programming a Flash game is different than typical game programming done in Objective-C/C/C++. So, if you are familiar with how to do things in the Objective-C/C/C++ game programming world (render loop, capturing inputs, etc), you'll really be ok. If not, you'll have to get use to not having the Flash timeline, dealing with frames, etc. Good luck! You can do it!

read the statements from apple, no its not possible.

For my game Hudriks I used flash to build levels and some animations. For this an animation engine has been developed that supports motion tween, and then wrote JSFL scripts that goes through Flash objects and export to a format that can be parsed in my game.
For writing the JSFL - look for document called Extending Flash.
The rest was developed from scratch using Objective C with OpenGL. Do not see option of 'one-click' compilation or converting from Flash to iPhone (not considering CS5), but with developing extensions for Flash you could reuse some work.

It is hard, but it is possible. I am working on a automatic code converter now.

Related

Audio Library C++ for a multicross platform use (iphone, android...)

i'm trying to make a C++ engine that will read a mp3 file, and make some image zoom/translation depending on the time of the reading sound file. I think I could use OpenGL ES to render what I want, and calling some OpenGL ES instructions in my C++ files, and init my drawing context in Obj-C/Java. I want to do the same for the sound, but i don't really know what to use, and if I can really do it or not in C++.
I searched for library so I found Bass and Fmod (which is not free for commercial use). They said it's multicross platform (Windows, Unix, MacOS) but I dont understand if it manners for mobile, and if I can really use it. Does anyone have been through this? Do you recommand me another free library?
Thanks again, and I apologize for my poor english,
Arnaud
Have a look at libpd (Pure Data for embedded applications)
http://download.puredata.info/libpd (the library has been released very recently, but the code is very mature indeed)
http://createdigitalmusic.com/2010/10/libpd-put-pure-data-in-your-app-on-an-iphone-or-android-and-everywhere-free/
Audio is often problematic and it is pretty much always a good idea to write your own high-level API that does exactly what you want to do (and nothing else) and to assume you will then be writing a thin layer between it and whatever audio library you are using underneath. If you're lucky and there's a library available that does things the way you would do them then it's trivial. If not, at least it's still possible. In either case, your app code is not tied to an external sound API.
I have used FMOD on multiple different commercial projects over the years for PC, Mac and iPhone, and have always liked it - but it's not free. OpenAL has always seemed sorta, I dunno: clunky? But you only have to deal with it when writing your API layer, and your app code never has to see it.
It's easy for me to say "write your own API" since I've been writing commercial games for 20 years and so know what I think an audio API should look like. If you don't have your own idea how you think it should be, then I suggest you look at a 3rd party library that makes sense to you and take the functions from it that you will be using and write your own API to do be a set of functions that do nothing but call those.
Since you have both OpenAL and FMOD available to you free for development you can then make your API work with both, and chances are it's then going to work with anything else you might come across.
OpenAL may be your best bet. Look at this answer: Android OpenAL?
It seems possible to compile OpenAL on Android.
If you are looking for just PCM audio input/output ( and not MP3 decoding ) try PortAudio or RTAudio
RtAudio or PortAudio, which one to use?

Making games in iPhone

Can anyone tell me what should i use to make games for iPhone...
Actually i am a simple application programmer ...but never made complicated high graphics games...
i have made some games but only simple one...
Which tool is good for me to start....
i am aware of OPenGL...is it good to start with this ??
I'd say if you're reasonably competent with iOS & Objective-C, then it might be worth taking a peek at the likes of Cocos2D. There's also the iOS port of Flixel (which you can grab with the source to Canabalt which is sitting on Github), but compared to Cocos2D - it's a little less polished due to it only being recently out there.
Unity's great if you're familiar with C# or JavaScript and interested in wanting to do 3D games - and if you're not as interested in going the full-hog with learning OpenGL ES.
Corona is the best thing for you start looking into.
I'd suggest a trip to the bookstore, to find a book which speaks to you, regarding iPhone Game Dev. A quick look at Amazon reveals quite a number.
There's a lot to consider when making games, it's a huge topic.
You should check out Unity 3D.
For someone new to iPhone development and game dev in general, I'd say start with Cocoa Touch as it is simpler than OpenGL and you can create simple games (for example words games) with it. And even if you decide to develop an OpenGL app for the iOs you still need to work with Cocoa so there is no escape from learning it.
Once you get your head around objective-c/cocoa/xcode and iphone development in general, then start looking at OpenGL.

iPhone to Flash porting

I need to port an existing game written for the iPhone to Flash. The iPhone game is mainly written in pure C rather than Objective C.
I'm wondering if there are any good tools for converting the C code to Actionscript directly, or in general if anyone has some advice on how to do this porting in an efficient way given its C based source code?
Since the game will keep getting updated with bugfixes etc, a method allowing rapid conversion of the updated game code to Flash so that only one code base would need to be maintained would be optimal.
Take a look at Alchemy. This might be what you want, but I suspect you will have issues simply compiling on different compilers since the user-input differs immensely between a flash game and an iphone game.

Any idea about an iPhone Accelerometer Library?

Have looked so long for a library specialized in dealing with iPhone Accelerometer but couldn't find anything.
I have made some few sample apps, but none reaches a level of accuracy as in Labyrinth games for example, so any idea about a library for that? Or maybe an open source app?
Would be better if it's integrated in a Physics library
UPDATE: I didn't mention it, but i don't want to use game engines. Specially now, that their future is still unknown. ObjC libraries or tutorials would be better.
I highly recommend looking at tweejump. It's basically an open source version of games like Doodle Jump. It really helped me learn how to use the accelerometer to control an object on the screen.
Although you said you didn't want any game engines, this is powered by the Cocos2D library. However, Cocos2D is written in Objective-C, so there shouldn't be any issue getting anything powered by Cocos2D passed Apple.
Best of luck!
It seems that it may just be easier for you to use a game engine that works with iPhone if you are looking to make a game. Here are 2 engines that export to iPhone GameSalad or Unity 3D

Engine for use with PC and Iphone?

Are there any engines that allow me to develop for pc and iphone at the same time? My preferred language would be c#, but that probably won't happen, so I probably will learn c++ or java.
I want a 2d engine, by the way.
No experience with it but...
http://www.torquepowered.com/products/torque-2D/
C# and Java aren't allowed on the iPhone, so a C or C++ engine would be your best bet. I'm guessing you're doing a game--if so, you'll probably want to use OpenGL. I don't know any specifically, but here's a full list.
Working with pure Core Animation layers can yield cross-platform 2-D drawing and animation between iPhone, iPad, and Mac. As an example of this, the Core Plot framework runs on Mac and iPhone from the same codebase. Core Animation lets you do some pretty complex animations and layout in 2-D.
It is against the rules in OS 4 to write an iPhone app in something other than Apple's dev tools. However, IANAL but I'd expect that it is in theory ok to take the app you made there and then try to run it on an emulation layer etc.. on the /other/ platform(s). Not sure about direct solutions, but check out the GNU Objective-C runtime / GNUStep, they might be a helpful starting point.