Today I'm releasing a very alpha, preview release of BennuGD for Android. It corresponds to revision 418 in the bennugd-monolithic source code tree and you can see a small video of a demo video (recorded with my iPad 2!) of Puzsion running in my Android phone below:
The video is from a couple of days ago; that's why I don't show game interaction as a couple of days ago multitouch events weren't being emulated as mouse events.
So, a couple of warnings:
- This is alpha quality code and you're supposed to know what you're doing if you want to use it. If you break it, then I'm sorry.
- Sound doesn't work. You can load mod_sound but if you try to play a couple of sounds at a time, your app will break. This appears to be a SDL2 bug that needs to be fixed.
For now I'm using the following code to suppress audio in testing games:
#ifdef FAKE_SOUND
#define stop_wav(a);
#define stop_song(a);
#define set_channel_volume(a,b);
#define set_song_volume(a);
#define unload_wav(a);
#define unload_song(a);
#define load_wav(a) 0
#define load_song(a) 0
#define play_wav(a, b);
#define play_song(a, b);
#define fade_music_off(a);
#define pause_song(a)
#define resume_song(a)
#define ALL_SOUND 0
#endif - Anything related to set_mode() beyond setting a video mode is either not working or untested. This includes scaling and rotation. Also, when setting the video mode be sure to set it to your device's display depth (usually 32bpp). Setting the video mode to a size different to your device's native seams to work fine, though.
You can, however, set rotation by modifying AndroidManifest.xml's android:screenOrientation value to any value described here. This is faster than BennuGD's implementation and works just fine. - Touch events will ONLY be emulated as mouse events if you import BOTH mod_mouse and mod_multi.
- This code should include all the official modules (minus mod_debug) plus mod_multi and mod_curl for handling multitouch input and server-client communications.
- Anything activity-based in totally untested: you're responsible for what your app does when in the background. Also, coming back from the background won't probably work, so be sure to make your app die when sent to the background, but I don't know if that's working (refer to the first point if you need clarifications).
- I don't yet know where to store your game's data (savegames, highscores...) in your phone, sorry. See first point in this list for more info :)
- You can use say() for printing debugging info. It'll appear with a "W/SDL/APP" prefix in the adb logcat and I like to filter the ouput of the logcat like this:
adb logcat SDL/APP:* SDL:* *:S - You can only set_mode once, and you must do it yourself. This version of BennuGD won't do it for you even if official BennuGD does.
- Please, report any bugs here. Reporting bugs elsewhere will probably result in me forgetting about it and. So please, ONLY report bugs there.
Now, for your question: "How do I get an APK from your package", here's a step-by-step tutorial:
- Get the Android SDK from here and set it up for your system. I don't use Eclipse and don't know how to compile the code with it, sorry.
Also, be sure to install API 10 -Android 2.3.3- from the Android SDK manager. BennuGD might work in Android 2.2, but I use API 10. - Install ant.
- Plug in your device or start the Android emulator. Be sure to enable debugging in the device.
- Open your console and browse to the path where you uncompressed the BennuGD for Android template.
- Modify local.properties to point to where you've installed the Android SDK.
- Type "ant debug install". This should install a debugging version of the sample program in your device and you'll be able to test whether everything is working properly.
If it's working fine, you can now try to get your game to work. - To do so, store your game's content in the "res" directory and be sure to rename your game's main DCB as "main.dcb".
Then remove the "bin" directory and re-execute "ant debug install". If everything went fine, your game should now be installed in your phone! Congrats :)
<<Get the code from here>>
0 komentar:
Post a Comment