Ejecta workflow for iOS

1

Index

Stats

4,029 visits, 7,365 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 23 Mar, 2014. Last updated 19 Feb, 2019

Older Ejecta plugin instructions

Sources:

Tutorial - Deploy your C2 game to iOS - The easy way by Taurian

Forum Thread - Plugin - Ejecta

Ejecta Kitchen Files - Required Files

Add Ejecta plugin and code to our game:

1. Download the plug-in from epicspace.net/insurgence/ejecta and add the OPlus1_Ejecta folder to your /Construct2/exporters/html5/plugins/ location.

2. Open your Construct application and 'Insert New Object' - 'Ejecta' to any layout.

3. Add Ejecta 'Events and Actions' to your project. In my project, I just wanted to utilize the leaderboards in Game Center so you can see in the example code here that I have a High Scores Layout/Event Sheet where the user can check their score either at the start or end of a game. If the score is > 0 and the game has been completed I 'Report' the score to my 'Leaderboard ID' I established earlier in iTunesConnect. Also, I have attempted to hide the leaderboard button if I can't authenticate but that didn't seem to work. I didn't test it very well, either. Then when user touches the leaderboard button, it is displayed; this worked perfectly.

Setup Ejecta Kitchen files for exporting and transfer to Xcode:

1. Download the Ejecta Kitchen from the same site where you found the plugin

2. Unzip to a location as a Master copy. Copy the folder and name it something representative of your project. Open the folder and delete the _MACOSX folder if you want.

3. Since I had to export my project many times while smoothing out some bugs, I found it easier to change the index.js and Info.plist files in my master folder so that I didn't have to update it with every export.

a. In the index.js file, un-comment the Game Center block so it will authenticate when the user starts the game. Or leave this commented out and authenticate within your application before sending data. Authentication requires the user to input their name and password so you may not want to do that at the start but I have and that's how it'll be for this tutorial. Also comment out the line var adBanner = new Ejecta.AdBanner(); if you are not using iAds. I'm not on this first game.

So your index.js should look something like this:

b. In the Info.plist file:

(1) I wanted the app to always run landscape with the button on the right so I changed the <key>UIINterfaceOrientation</key> string to <string>UIInterfaceOreientationLandscapeRight</string> . These are key/string pairs so dont change the key by mistake.

        <key>UIInterfaceOrientation</key>
    	<string>UIInterfaceOrientationLandscapeRight</string>        	

(2) And lastly, I changed the <key>CFBundleIdentifier value to <string>com.bogueratcreations.${PRODUCT_NAME:rfc1034identifier}. Don't put the final bundle identifier suffix here as you'll need to change that in xCode so your app name appears under your icon. just change the 'com.yourcompany' portion.

    	<key>CFBundleIdentifier</key>
    	<string>com.bogueratcreations.${PRODUCT_NAME:rfc1034identifier}</string>

c. I also replaced all the icons in the 'Resources' folder with the ones for my app. There were some legacy sizes that I also added.

Now that the master EjectaKitchen folder is prepared, make a copy to use for our export. I was just adding a number like so EjectaKitchen1, EjectaKitchen2, etc.

Export the project and prepare for Xcode:

1. Export your Construct2 project as an HTML 5 Website to the EjectaKitchen/App folder. Do not minify the script.

2. Browse to the App folder and run either .bat file. I couldn't get my app working with the EjectaXporter_WebGL.bat but it worked fine with the 2d.bat file.

3. Copy the EjectaKitchen folder to your Mac OSX device; virtual or real.

Note: I also deleted all the .ogg files from the project since they are not used in iOS.

now go back to the Xcode test setup section to continue

  • 0 Comments

Want to leave a comment? Login or Register an account!