FNI Touchscreen games using Adobe Flash and AIR
4/03/2010Last month YoungWorks approached us at Beyond Reality for a project that needed touchscreen applications. They were working on a trailer to promote the Floris Nightingale Institute ( FNI in short ). This trailer would travel from school to school and was going to give information to the kids about FNI and hopefully make them enthusiastic about the Institute.
The trailer would have two rooms. A movie room where the kids got to watch a 3D promotion film and a room with 3 touchscreens with games. I got to create these games. Creating touchscreen apps/games with Adobe Flash is a piece of cake, but Flash kinda sucks balls when it comes to standalone apps because you dont have any rights to write files localy. Saving scores and data online was out of the picture because the trailer didnt have an internet connection. So this is where Adobe AIR came in handy. With AIR I was able to enhance my Flash apps with a lot more options for local storage. With Flash+AIR you can store data in a local SQlite database, and you can generate and manage files. In this case I had to make 3 touchscreens and thus 3 PC’s work together realtime. For instance; when the play button was pressed on one screen all the screens had to start te game. For this I came up with a trick where I checked if a file was present on a network drive every frame. As soon as a button was pressed on one of the screens this file got generated. All the screens instantly found the file and started playing simultaneously. There didnt seem to be any delay between me pressing the button and the apps starting the game. The game even had an Flash Video ( .flv ) intro that played perfectly sync on all of the screens.
I had another problem with the SQlite database and storing the scores. I noticed an SQlite database only allows one write assignment at a time. This sucked because the screens got to a point where they all wanted to write the end score at the same time. So I simply made them wait for eachother in order. So screen #2 only started writing the score after it found the ‘ScreenOneIsDoneWriting’ file that got generated by screen #1. And naturaly screen #3 saved its score to the database only after it found the ‘ScreenTwoIsDoneWriting’ file. Even this didnt show any delay when looking at all of the 3 screens.
I see great potential in Flash+AIR, especialy with its multi-touch support and the upcoming multitouch tablets. The iPad doesnt seem to have Flash support but I’m guessing Flash CS5 will have export options for this device, just like it has for the iPhone. You will probably need a developers licence for these export options though! Apple doesnt want to lose its Appstore monopoly! (>_<)





No comments yet.