11-17-2010 05:25 PM
I am very excited about the playbook and have ditched my attempts to create a android game and instead want to create it for the playbook. But I'm finding it very tricky to get a hold of any source code. Are there any samples about?
Also can someone give a rough outline of what I need to do to create a game my basic understanding is to have a update method and a draw method and just loop through them what I can't quite figure out is the basic layout. Is there any sample code that could help? maybe whenever a click event is detected an image is drawn there?
Sorry I'm being so vague this is all new to me (I know c# and the basics of java but not a lot else)
Thanks very much
11-17-2010 05:35 PM
Unfortunately there is not much sample code available yet. However, so far I have found ActionScript to not be all that different from C# and Java.
11-17-2010 05:41 PM
I would not continuously loop since that will bottle neck the application and drive the CPU up. Flex/AIR is an event driven system. I would listen to frames and update the current state from that. An Image can be listened to when a mouse click (or enter, leave, etc.) and you can then respond that mouse click event.
There are lots of tutorials on Flex/AIR and sample code out there. Adobe AIR docs area at
AIR also has built in effects to move, resize, etc (tweens) that can animate a lot of items as well that has better performance then moving an item on each frame.
11-18-2010 06:02 AM
jtegen is right, an infinite loop is a bad solution when it comes to AS3. Use Event.ENTER_FRAME instead. To create as3 games, have a look at the kongregate video tutorials, they are well explained:
Hope this helps,
11-18-2010 07:37 AM
Thank you all so much the links are perfect (you have been really really helpful) I'm at work now but I can't wait to get home and start coding something up. If I get anywhere I'll post back (more than likely with questions - sorry in advance)
11-18-2010 08:24 AM
Cheers for the kudos .
If it suits you well, you can mark this as Solved in the forum so that other readers can find it as well.
11-18-2010 10:04 AM
You make also want to look at the Timer class. It can send a callback to the milis-second level independent to the frame rate. However, if the application is busy (or OS), and you are doing a lot of processing in between the timer duration (<10ms), you r application may stall momentarily at times. It's a balance of updating the display (time needed), refresh rate, and user interactions. Updating on frame rate can be done in conjunction with the Timer class, it all depends on what you are doing. AS in not multi-threaded, so if you are trying to update 1000+ assets at one time, you may have to start using some coding tricks.
11-18-2010 10:44 AM
I also have another question. I saw a video of someone at adobe using the same code to run a AIR game on ipad/android pc etc. So does that mean if I make a app for the playbook with air it will be easy to port to the other platforms?
If I wanted to do this is there anything I need to keep in mind whilst making the app? and would these apps even be allowed on the respective markets (I thought android limited to java and iphone to objective c etc) Also I see no mention of windows phone 7 but that video at least made it look like once the code is done it's trivial to get it running on other devices.
One more question I'm poor and have downloaded adobe flash builder to make the apps (I think this is the only real solution) but if I can get an app finished within the 60 day trial can I release it? or do I need to pay for a licence?
Sorry loads of questions and really off topic but I thought better than posting a new topic.
11-18-2010 11:05 AM
Yes, your Adobe AIR application can run on ipad / android and pc, it's all about packaging the right think (apk, ipa, bar, air...).
So far, you have to use AIR 2.5 SDK for Android and BlackBerry (BB just adds come components to make it easier and platform coherent).
Here is a chart to compare the capabilities :
Here is a video i made that shows my application running on an Android 2.2 (HTC Desire) and on the BB Playbook simulator. I tried packaging on the ipad / iphone today and it worked (bit laggy because of what i said).
Adobe didn't make any announce yet about W7 phones as it is all new.
If you can't afford a Flash Builder licence (standard is fine, don't bother with the pro licence), you can still copile using command lines but Flash Builder will save you plenty of time, it's worth the price really.
11-18-2010 11:14 AM
In theory, if you are just using the SDK 4.5 (which is not supported for the playbook yet), and keep to the "spark" framework, and all your controls resize based on the platform it is running on, then probably yes.
However ( and there is always a however ), the playbook (PB) has its own SDK ontop of the Adobe AIR SDK for controls more suited for a multi-touch screen like the PB. They will also have controls that are highly optimized for this multi-media device (video, audo, browsing, etc.) This SDK will not be available or probably work on Android or other devices. The PB is a device trying to get market share from Apple iPad, so it is targeting a different consumer than Android or even non-BB phones. The PB will work with other BB phones, I doubt it will ever seamless work with non-BB phones (no business sense to do so since Android capable phones compete with BB phones).
The other however, is the real estate difference between the PB and the mobile phones. The PB allows for a lot more room (not as much as the iPad), but a lot more than any phone. So an application built for the PB should have more features than a similar application on a phone because you have more screen space, memory, CPU power, and diskspace. Items that should be taken advantage of to give the end user a rich experience, one that they cant get on a cell phone.
New devices and OS always have the chicken-and-the-egg situation. People dont buy hardware unless it has the applications to make their life more fullfilling (business, games, information, etc.). Most software vendors will build applications for a new platform unless it has or will have a market share will give them some return on investiment. Hence the reason why the 125+ deveopers on this list comes in and the give-away for a free PB by the release of the device. However, if the quality is not there, Apple will have a field day on the small number and poor quality applications. I am certain BB is working with some big names applications to make certain they are available upon release.
We too have a chicken-and-the-egg situation with the SDK and OS. This is BETA software and there are features missing or not ready yet to make it possible to build those quality applications. If we wait too long, it may be impossible to get the application done and accepted in time to receive the free PB. I am personally working on about 6 applications that have different mesures of success with the current SDK and platform. I hope 1 or 2 will converge in time with SDK updates and the product release.
Long winded answer. In other words, build natively (AS/QNX/ETC) to take advantage of the hardware and give the consumer some WOW factor so the platform is a market success for BB so inturn it will be a continued market sucees for each of us.