iPhone and Android programming for mobile games? [closed]
I want to write simple games for mobiles, something like a good Tetris program. I want it to work on Android and iPhone phones.
My current knowledge of programming is fairly good in web development such as PHP, MySQL, HTML, CSS, JavaScript and C/C++, and Java, all intermediate level, and basic OpenFL programming.
I have the following questions:
- If I code in XCode can I port/deploy it on Android phones?
- What are the languages/packages I need to learn?
- Can I get some helpful tutorial links to the same for a new bee?
Most of the people I know that port between iphone and android using the native tools use C++ / OpenGL ES / OpenAL and small amounts of objective-c / android NDK to handle the OS specific stuff. You want to reduce the OS specific code as much as possible as that is the code you have to rewrite for new platforms.
This can be a lot to handle if you have never done it before.
If it's your first time doing game development you may like to go down another path like Unity3d or Corona SDK. Since you want to do 2d game development Corona may be a better fit.
Both Corona and Unity3d have great forums that will help you out.
If you want to learn Objective-C, then I would suggest the Cocos2D engine for 2d game development. Again they have a great forum for asking questions.
For iPhone you will have to know Objective-C For Android you have more choices Java should be the first one on the list. And the of cause you could use the android-scripting framework.
Android Scripting
A Pretty interesting Project is Titanium by appcelerator.
Titanium
You can use Javascript, HTML5 and CSS3 so it might work out pretty well for you. They furthermore have a pretty big community.
Hope this helps!
- Depends what you mean by port. In general it's not a straightforward task. Both Android and iOS have OS-specific APIs which you will use. Additionally, the languages are also different (see #2). The language and platform differences will likely cause you to write your application somewhat differently.
- For Android: Java. For iOS: Objective-C. As far as gaming goes, OpenGL will serve you well. You could consider using a 2D graphics library that will abstract that a bit too like libGDX, AndEngine, or Cocos2D. If you do though, be aware that if that library isn't on both platforms, you'll have an even harder time porting. Again, for each platform you'll want to look at their platform docs too. Here for Android, and on Apple's developer site for iOS.
- As far as Android goes, look at the source code for Replica Island. Can't say I can recommend you a great iPhone game dev tutorial unfortunately.
The native SDK for iOS uses Objective-C, and the native SDK for Android uses Java. Most people develop native apps in those languages directly. Even if they shared the same language, the two system's work so differently under the hood that you wouldn't be able to share the code directly. In both cases however you can use C++ to do most of the graphics programming in OpenGL, so that part at least you could share directly.
There are a number of cross-platform solutions available however, allowing you to deploy both iOS and Android apps from the same codebase. For a 2D puzzle game a pretty ideal solution is Corona SDK.
A major misconception by many game developers is that it's somehow better to develop your game specifically for either iOS or Android from the start. I've been developing mobile games for years and am finding that developing portable games that run perfectly on both Android and iOS takes no longer than writing specifically for one - so long as you use one of the modern platform libraries, like BatteryTech. Porting has been a non-issue for us since we switched.
I want to answer on the second question. Look at this post to see the Infographics that visualize what language uses every OS. I think it will be quite helpful for you.
精彩评论