iPhone Projects
Project Setup
- iPhone development must be done on a Mac.
- Register as an iPhone developer with Apple and download the iPhone+Xcode SDK.
- Create a Plasmacore project in the normal way.
- Place sounds that are common to all target platforms in the sounds/ directory (e.g. WAV files).
- Place iPhone-specific sounds in the sounds/iphone folder (recommended: IMA4 and WAV).
- Load "project_iphone/game.xcodeproj" in Xcode.
- Add each of your sounds as a separate resource by right-clicking the "Resources" folder on the left-side list.
Simulator Build
- Run the "ant vm" build task outside of Xcode. You must do this every time you change your source code.
- Click the big tab at the top-left of your Xcode project window and choose "Simulator 2.2.1" (or better), "Release", and "game_vm". Note that building the Mac version with "ant build" will compile the the necessary code for the iPhone version as well.
- Click "Build and Go" or press Command+Return.
Device Build
- Add your iPhone as a development device on the iPhone developer website.
- Create and install a development certificate (e.g. "prototypes") following the instructions on the developer website.
- Add the your device to the certificate you made.
- Go to Project->Settings and set your "Code Signing Identity" to be "iPhone Developer" (it should say something about matching your developer name in your certificate).
- In Xcode, edit "Info.plist" in the "Resources" folder and change the "Bundle identifier" to "com.yourcompany.gamename" (e.g. "com.plasmaworks.wyrmhunter"). The company name must match the one you gave on your certificate.
- Run the "ant vm" build task outside of Xcode. You must do this every time you change your source code.
- Click the big tab at the top-left of your Xcode project window and choose "Device 2.2.1" (or better), "Release", and "game_vm".
- Click "Build and Go" or press Command+Return.
Cross Compiling to C++
For regular development the virtual machine build on the Mac is plenty fast. For the fastest execution on iPhone - and to satisfy Apple's requirements that interpreted code not be run on the iPhone - you'll need to cross-compile your game to C++ (cross-compiling is currently only available for iPhone). This is a longer build cycle so it's not recommended for quick testing during development.
- Run the "ant xcom" build task outside of Xcode. You must do this every time you change your source code. This will produce several C++ files in the build/ directory: build/game_1.cpp, build/game_2.cpp, etc.
- In Xcode, right-click on the Targets->game_xcom folder and choose "Add->Existing Files".
- Select all the ".cpp" files in the build/ directory. Leave out the ".h" file.
- Adjust the build configuration list to be either "Simulator" or "Device" (each is described above), "Release", and "game_xcom".
- Click Build & Go or press Command+Return!
Miscellaneous
- The image "Default.png" is the "splash screen" that first shows up when you launch your game. It's set to be the Plasmacore logo by default - you're under no obligation to keep that and can replace that if you want.
- Replace "Icon.png" with whatever 57x57 icon you want. You don't need to add in the rounded corners and glossy streak - the iPhone does that for you.
- If you want to disable the glossy icon (as we did for Wyrmhunter), uncheck the "UIPrerenderedIcon" option of your Info.plist. If that option doesn't show up you can manually add it by editing the XML source code for that file.
- To set the actual app title you'll want to set "Product Name" in the "Packaging" section of your project options.
- Upon submission to the app store you'll also need to submit a 512x512 "icon" that should look similar to your smaller icon. Apple uses this icon to when displaying your app's info on iTunes - however, they scale it to 100x100 so make sure it looks good at that resolution as well.
- Login to post comments
