Walk through our deferred lighting demo using Adobe AIR Gamepad!
One of the latest features released with AIR was Adobe AIR Gamepad. Basically, if you have adobe AIR installed in your Android phone or tablet you can use it as a joystick in your game. The integration is really easy (check out Adobeâ€™s tutorial here) and provides you with a lot of possibilities such as adding the joystick functionality for your game or else you can use it as a second screen for interactive applications.
To play the demo you must follow the following steps:
Important: Flash Player 14 (or higher) is required
- Open the demo here
- Launch Adobe AIR application in your phone or tablet.
- Shake your device to enable AIR Gamepad.
- Type into the demo the code that appears in your device and press â€œconnectâ€
- Once you get connected your device will vibrate and you will see on the device screen the touch areas for walkingÂ and looking around into the demo.
This demo uses our “Deferred lightning”Â example. You willÂ find the demo’s source code at Flare3D Labs inÂ aÂ new folder called “gamepad” which has beenÂ added into src.
The VirtualPad class receives a gamepad’s reference and handle the input in the same way.Â This class was made to detect traditional touch events, but with a few changes was adapted to work with AIR Gamepad. As a complementary information you can checkout AIR Gamepad docs here.
Interpreting the input
AIR Gamepad recognizesÂ Multi Touch and gestures input and send them to your application. So you can catch the input asÂ ifÂ your app would beÂ running in the mobile device. Once the connection between the app and the device has been establishedÂ you are able to skin the device’s screen sending an image. In our demo, we are sending an image that shows a reference indicating the touch areas on to the screen.
It’s time to play!