Engine for use with PC and Iphone? - 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.

Related

Cross-platform development with GLKit?

I've just installed the current Xcode 4 release and realized the new "GLKit" API thats also used in the OpenGL Template for iOS. So, I want to develop an cross-plattform game for iOS, Mac & Windows. GLKit seems like a step backwards in terms of portability, but the GLKit Features (specially like asynchronous texture loading) are great benefits...
How can I develop a cross-plattform game with GLKit? I would need to write any grapics code twice, right? Or is there something like an GLKit implementation for windows?
Any idea, workaround, code-design advice (how to divide the GLKit Code from other components?) is welcome - thanks!
I can't think of anything that GLKit does which cannot be replaced by non-GLKit code. It can make some OpenGL ES 2.0 tasks simpler by abstracting them away from you, but it doesn't do anything unique. The closest it comes to having something you can't replicate elsewhere (from what I've tinkered with) is the accelerated matrix and vector math functions it provides, but even those could be replaced with a little Accelerate or NEON code.
While I'd like to use GLKit within my applications, I'm still supporting iOS 4.2 with them, which doesn't have GLKit available. There's nothing that I'm currently prevented from doing because I can't use GLKit, I just have to write a little more code to handle things like view updates, texture uploads, matrix math, etc. There's plenty of documentation and examples out there for these operations, so you don't need to worry about being on your own when it comes to implementing them.
You're going to have much larger problems than GLKit when trying to make your code be cross-platform with the Mac, and expecially so with Windows. Desktop OpenGL and OpenGL ES have some differences in their implementations, and you'll need to be aware of the places to substitute one function or built-in variable for another. CAOpenGLLayer and NSOpenGLView on the Mac are also different from the CAEAGLLayer on iOS, and AppKit overall is a different animal than UIKit.
Windows will be even more of a challenge to support, because you won't be able to use any of the Cocoa frameworks, and most likely no Objective-C as well. This will take a lot more of your time than any OpenGL / OpenGL ES differences.

Iphone game dev, c++ / mac comparison

Hey guys, I've done some research but still unsure.
To get into IPhone Game Dev properly do I need to use Objective C rather than C++ ? I'm happy to invest in a mac mini and want to make sure I'm using the same systems/platforms professional Iphone Dev's use. Are most of the tutorials out there in Objective C E.T.C?
Cheers!
it's totally up to you. If you decide to write your own game engine you can do it in Objective-C or C++. IMHO there is no single proper way to do game dev. I use mac mini and do parts of my coding in c++ if I find that easier than coding in Objective-C. After all you don't want to mix engine stuff (probably using opengl) with ui stuff so your code gets separated anyway. It honestly doesn't matter what is the language of your game engine as long as you can use it on idevice and are comfortable writing in.
So to sum up, you don't have to cling to one language. Write your UI in objective-c and prepare the environment to use opengl and then write your engine in c++ if that suits you.
The fact that OpenGL ES is written in C means you can use C, C++, Objective-C or Objective-C++ to write your game engine. So use what you're comfortable with.
Many of the books that I've seen out there assume C++, but as I say, you can do your engine in anything of the above.

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.

Port Flash to 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.

How to create a smoke effect in iphone?

i am developing an application where i want to do some smoke effect like animation and interact with that smoke.
Do i need to implement it OpenGLES or any simple solution?
Is there any sample application for it?
You could just write a simple particle emitter for that. Is it for a Game ? or for another kind of Application ?
It also depends on the level of realism that you're looking for. A guy got down voted for mentioning fluid dynamics, but if you really want realism, that's the best way to go.
Having said that, you can really get decent smoke using a regular particle emitter (you could even try to code it on Core Animation and not in OpenGL ES).
Also, if you're targeting iOS 5.0+, UIKit now includes several Particle FX that you could use, you just have to play with the parameters... checkout this tutorial
Cheers!
Yes, its possible with simple solution. You just need to use UIKit particle system.
Have a look that sample https://github.com/lichtschlag/Dazzle, you just need to check fire and smoke sample.
Good luck
Hmmm... i have no knowledge about OpenGLES, but there an alternative called iProcessing is designed to create native interactive apps for iOS, actually there no iOS version 5, actually are iOS 4 and iOS 3, maybe we can wait when they release new version of iOS 5.
You need a mac to use Xcode, iProcessing package includes sample projects for Xcode.
http://luckybite.com/iprocessing/
Honestly, i haven't tried it, but you can compare this code of the interactive smoke http://processing.org/learning/topics/smoke.html.
Processing is awesome because you can use same codes for Processing.js and iProcessing, but it depends like importing libraries like OpenGL, etc.