Developer Mode is a feature to speed up developing games with OpenAphid-Engine. The behavior of OpenAphid-Engine changes if the developer mode is turned on.
How to Enable Developer Mode?
Open your project with Xcode and locate the following lines in
[self.viewController.glViewController configBundleName:@"game.bundle" baseURL:[NSURL URLWithString:@"http://22.214.171.124:18080"] developMode:YES];
Setting the value of the
YESenables the developer mode of OpenAphid-Engine;
An HTTP server should be used to host the content inside the bundle folder specified by
configBundleName. The value for the
baseURLparameter should be set to the server address too. A ruby based tiny HTTP server is included in our boilerplate project, please refer to the
start_dev_server.shfiles for more details;
The application should be built and re-deployed to devices with the new settings.
And for the Boilerplate-iOS project,
YES in its info.plist file; which makes the app terminate automatically when the Home button is pressed.
Changes in Developer Mode
The main benefit of using developer mode is that it makes the game development speedy like developing for web:
Graphics resources are fetched remotely too. For example, a texture can be created by using
new aphid.g2d.Texture2D("player.png"); the
player.pngfile is fetched via
http://126.96.36.199:18080/player.pngin developer mode. OpenAphid-Engine Runtime also prints a log about it as following:
1 INFO 05/02/12,13:41:32: (developer mode) loading data 'player.png' from remote: http://188.8.131.52:18080/player.png
- Internal warning and error messages are displayed as on-screen notifications besides logging in device console. Warning messages are in blue background color and errors are in red color. The screenshot below shows a notification about a syntax error at line 17 in main.js:
Messages produced by
console.errorare also displayed as notifications;
Write access to read-only attributes of OpenAphid-Engine objects throws exception in developer mode.
With the developer mode of OpenAphid-Engine, the typical development process is as follows:
Presses the home button and enters the app again to see the result of the changes;
Hope you like the developer mode of OpenAphid-Engine. We’ll improve it constantly to make game development easier. Please feel free to contact us if you have any suggestions.