Dual virtual joystick controllers in AS3 for iPad
Date: Tue, 10/04/2011 - 12:43pm
Now that Flash Builder 4.5 can build mobile applications for iOS, Blackberry Tablet and Android devices, there will likely be an explosion of Flash games on the mobile markets. One such example is Machinarium, which is a Myst-like Flash puzzle game that was republished to be played on the iPad 2. For a few weeks it was the top paid iPad app on the Apple app store.
There are a lot of Flash games out there in the webisphere that could be published to Apple and Android app stores, as long as the controls are updated to work with mobile devices. That could be very good news to gamers and game developers alike. Just think of how many great Flash games are unplayable on the iPad and iPhone (we're looking at you, Apple).
After a lot of back and forth and research, Studio's dev team finally created working dual virtual joystick controllers for use with Flash games built for mobile platforms. It wasn’t easy, but with some understanding of the relatively new AS3 Multitouch classes, we were able to build a controller class that uses an array of touch points to allow for multiple controllers on the same screen.
We've been working on a Geometry Wars clone game built with the Flixel framework. We wanted the user to be able to play the game on an iPad with two virtual joysticks as the controllers instead of keyboard keys (which aren't found on the iPad). With the left joystick, you can control the ship’s direction and movement, and with the right joystick you can shoot in any direction. You can move the ship and shoot at the same time, just like if you were playing the official Geometry Wars game on the Xbox 360 (which just happens to be one of our favorite arcade games, ever).
The game isn't finished yet, but we're making steady progress, and soon it will be worthy of being played on an iPad. When we finally finish the app, we'll post our controller source so that everyone can share in this Flash game goodness.











