Could I rewrite the attached AS1 Flash game and create a HTML5/JavaScript/CSS3/PhoneGap iPad app with the same performance? - ios

I have a successful kids educational maths game made in Adobe Flash ActionScript 1, its a fairly simple game but there is animations for example a plane crashing into our logo and breaking it apart.
Could I use HTML5 and tools such as PhoneGap and get it to work like it does now in an iPad App and get Apple to accept it on there App Store? I'm drawn towards HTML5 because its non-propriety and has a promising future but will it be able to replicate the game. I've noticed the featured games on the PhoneGap website aren't very interactive/game like compared to Adobe AIR app examples.
Thanks

You could definitely recreate the game in HTML5 and use PhoneGap to package it for iOS. As long as you follow the app store guidelines, there's no reason why the game wouldn't be accepted by Apple.
The game logic seems straightforward enough and should, therefore, be relatively easy to translate to JavaScript. However, I think there may be significant effort involved in reproducing the animations you have, to an acceptable level of performance, using standards-based web technologies.
There are a few avenues I can think of which it might be worth your while exploring:
Google's swiffy will convert SWF files to HTML5 so you can use them on devices which don't support Flash. I have used it successfully to convert a reasonably complex Flash animation, however the performance of the animation on the device, when it was packaged as a native app for iOS using PhoneGap, was significantly worse than the Flash version. I'm not sure whether the tool would be capable of converting the whole game (definitely not if it's pulling in dynamic data), but you could certainly use it to translate the individual animations of the game.
Adobe Edge is an animation tool similar to Flash for creating animations in HTML. I've not used it so I don't know whether it's any good. However, it is still a relatively new product and a quick search for character animations using Adobe Edge wasn't particularly encouraging.
The CreateJS toolkit for Flash Professional is a free extension which will convert Flash animations to JavaScript using the open source CreateJS framework (which looks superb and may be a good starting point for rebuilding the game should you decide to convert it).
Convert the game logic from ActionScript 1 to ActionScript 3.0, reuse all your existing animations as is, and package the game for iOS using the Adobe AIR packager. Inevitably the performance won't be comparable to native, but I think it should be acceptable for this type of game.
I think in your case I would probably go for option 4, primarily because you'll save yourself the effort of recreating / converting existing animations in another technology. I would definitely encourage you to embrace HTML5 and associated technologies but would suggest you use them on a new project which will allow you to plan around its particular strengths and weaknesses.

Related

A-Frame: FOSS Options for widely supported, markerless AR?

A-Frame's immersive-ar functionality will work on some Android devices I've tested with, but I haven't had success with iOS.
It is possible to use an A-Frame scene for markerless AR on iOS using a commercial external library. Example: this demo from Zapworks using their A-Frame SDK. https://zappar-xr.github.io/aframe-example-instant-tracking-3d-model/
The tracking seems to be no where near as good as A-Frame's hit test demo (https://github.com/stspanho/aframe-hit-test), but it does seem to work on virtually any device and browser I've tried, and it is good enough for the intended purpose.
I would be more than happy to fallback to lower quality AR mode in order to have AR at all in devices that don't support immersive-ar in browser. I have not been able to find an A-Frame compatible solution for using only free/open source components for doing this, only commercial products like Zapworks and 8th Wall.
Is there a free / open source plugin for A-Frame that allows a scene to be rendered with markerless AR across a very broad range of devices, similar to Zapworks?
I ended up rolling my own solution which wasn't complete, but good enough for the project. Strictly speaking, there's three problems to overcome with getting a markerless AR experience on mobile without relying on WebXR:
Webcam display
Orientation
Position
Webcam display is fairly trivial to implement in HTML5 without any libraries.
Orientation is already handled nicely by A-FRAME's "magic window" functionality, including on iOS.
Position was tricky and I wasn't able to solve it. I attempted to use the FULLTILT library's accelerometer functions, and even using the readings with gravity filtered out I wasn't able to get a high enough level of accuracy. (It happened that this particular project did not need it)

is Adobe Air capable of converting a complex Flash game into iPad/android platform game?

I've recently heard about the converting feature of Adobe Air but how well does it work?
Does it emulate every bit of code a complex Flash game using tons of libraries outputs or should you expect a lot of work to go around if you were to convert one?
I'm thinking of making a complex cross-platform game but not sure which is better/easier, to use Flash and Adobe Air for its abundant game libraries, resources and faster development or to simply go with Java.
It Would really save lots of time if I can use Flash. Though, I can imagine it would also give me headaches to worry about all the time. Like what if adobe/apple stops supporting Flash or what if the converting feature won't work.
Any advice and any bit of information would be welcome. Thanks.
AIR works well on iOS in my experience although native apps will always perform better. I cant think of any aspects of Flash that wont work when converted to run on iOS.
Whether AIR performance is good enough really depends on the individual case - how gpu and cpu intensive the game is.
You have to consider the trade-off: use existing Flash skills to create a 'good' game quickly; or learn new skills to create a 'better' game slowly - is it worth spending weeks/months learning new skills to get a few extra percent of performance? Only you can decide that.
Regarding Adobes AIR support in the future; who knows - they dont have a great track record (think flash on mobile) - but i would suggest AIR will be around for at least the medium term, if not long-term.
My personal opinion is that "mobile" is not going anywhere and now is the best time to start learning Java for Android and/or Objective-C for iOS. Like PhoneGap, Flash mobile Apps don't give you complete access to the devices entire API/SDK options, even though what they do offer usually suffices. Flash is still a respectable tool but developing "native" gives you full control over your app's memory, device interaction, cutting edge APIs, etc ...
Depending on how optimized your action script 3 code is written, you may experience some performance issues vs utilizing native graphics libraries. I assume the latest version of AIR (I know Flash 11.2 and on included some nice graphic stuff) may address performance but haven't seen any benchmarks for AIR on mobile devices yet.
If you are hoping to go the AIR route, I'd say why not take a few days and try to port it over. If all else fails get a nice iOS or Android book and cuddle with it every night until you are confident you can recreate your App natively.

AIR SDK: performance of SWF compiled into iOS native app

It's a great thing that it's possible to compile an SWF into iOS native app. I think AIR is now the best option to write e.g. small games or interactive books. Of cause AIR app will be slowler than the same app written on e.g. objective C. The question is how slower AIR app will be. Can simple AIR apps be launched e.g. on iPhone 3G or iPAd 1?
And another question is, can arbitrary flash app be compiled into iOS native app?
Will be grateful for any thoughts!!!!!
Performance of AIR vs. Objective C:
For pure script execution, AIR apps perform rather slower than native, including on iOS. However, in virtually all cases the limiting factor of your app's performance will be rendering, not script, so it depends entirely on what you do visually in your content. This is why Crooksy suggested you look at Starling. Without Starling (or similar libraries that make use of the GPU), it's pretty challenging to get decent performance out of an iPad1. It can be done, but it takes expertise and incurs extra work. It will be much better to start with the huge performance boost of using Starling or similar.
Can arbitrary flash app be compiled into iOS native app?
As long as it's made with AS3, then it should compile. For whether it works, two main caveats come to mind: First, a handful of APIs don't work on mobile devices. (I think printing is one example.) Second, if you read in any SWFs at runtime, all actionscript inside them will be ignored. (Not for technical reasons, it's an Apple requirement.) So if your content is split into a bunch of SWFs you'll need to bundle them together at packaging time, and if you absolutely depend on reading in SWFs with script from the network at runtime, you're going to hit a wall.
Hope that helps!
Check out the new Starling frame work.
http://gamua.com/
Here's the start of a nice tutorial series (episodes 1 and 2)
http://www.hsharma.com/tutorials/
Lee Brimelow also has a few tutorials
http://www.gotoandlearn.com/
Regarding converting Flash apps into iOS compatible apps, yes that is possible but it depends on what the app actually does as to whether any modifications will be needed before it will perform correctly on a device.

Html5 for iOS game development

I have been hearing of the advent of html5 for iOS development. I know nothing about web dev technologies and am wondering, can this really be used for iOS game development? Just hearing html makes me think this will be used for web related apps, not things like graphically dynamic 2d games, but being unfamiliar, I'm hoping to get some insight from the experts here. Is html5 going to be useful at all for games, or should I basically expect to be sticking with the likes of cocos2d for iphone?
The short answer is "Yes, you can develop full speed, interactive games with HTML5". Check out "Private Joe", "Biolab Disaster" and "FUBAR" in the Apple app store. All were created with HTML5, Javascript, and a few javascript libraries (ImpactJS and Box2D).
One thing you'll see as you explore this is the repeated caveat that "web games aren't fast enough", also "Web games can't use the device's goodies - like GPS, vibration, etc."
These statements represent "common thought" and are not really true anymore. Companies like PhoneGap and appMobi have tools that make it possible to do anything in HTML/JS that can be done in native apps. Browsers keep getting faster, and smartphone processors also keep getting faster. Qualcomm's new chipset even has GPU acceleration for future smartphones.
As an added bonus from coding your app in HTML5, you will have the choice of whether to compile it app into a native app and post to one of the app stores (using appmobi or phonegap), or to offer it yourself as a web app (saving the Apple censorship and 30% tax).
Viva HTML5!
The real benefit to using HTML 5 for game development is that it's a write once, deploy everywhere strategy, meaning you can write the same code and have it work on iOS, Android, Windows, MacOS, Linux, etc, as long as it has a browser.
The HTML5 canvas element supports both 2d and 3d (on some platforms), so you can use it for complex games as well.
This will, however, run in a browser, so the only way to sell it in an app store is to wrap it in a UIWebView container or the like.
Also, there are games written in Canvas (just google it, also google 'chrome experiments' to find cool 3d stuff in HTML5).
I wrote this HTML5 Tetris implementation: http://htmltetris.com
It is designed to be equally playable on a PC and on touch devices supporting Javascript touch events.
One of the important things to get right in a mobile game is the control scheme and it took some thinking to come up with the swipe/tap control scheme used for Tetris here. But it turns out quite playable (in fact, just as playable if not more so than all of the tetris like iOS apps I have tried, and there are... quite a few of them) and is proof that it is possible to build a perfectly playable game with HTML5 technology.
Check out HTML5 Canvas. Lots of Web games are based on this tag. Here are some samples :- http://www.canvasdemos.com/type/games/
There are two great things about investing your time in learning HTML5 and its counterparts:
For one, every application that you write will theoretically be able to run on many platforms. iOS, Android, Windows, Mac, Linux, etc, all have HTML5 capabilities. You'll also be investing your time in a language that is still being developed, so you'll already know the ins-and-outs of it as more features are added, and you'll have mastered it when the final product finally goes mainstream.
The capabilities and power of HTML5 are only expanding, so the experience with the language should only improve with time ;)

Any Resources for Pure Actionscript 3 Games?

What resources (books or website/tutorials) are available, that cover game development using pure Actionscript 3 code? By pure, I mean not using Flash CS4 and its timeline, and not using Flex MXML components. Everything done using only Actionscript code.
In another question, I asked about using certain objects of the Flex SDK for simple games, and the consensus was that I shouldn't use it at all, but only Actionscript for a game. Sounds reasonable, but the books/website tutorials that I have found on the subject of games, all use AS3 in the context of Flash CS4. They assume your objects will be movieclips, with timelines, etc.
I realize that you can learn game programming from books in other languages, and/or ignore the Flash aspect of AS3 books. I guess what I'm looking for, is whatever information is specific to AS3, such as best practices for AS3-only games, how to make architectural/design decisions, etc. If it exists, anyway :)
You may want to take a look at Flixel.
What is flixel?
flixel is a completely free collection of Actionscript 3 files that helps organize, automate, and optimize Flash games; an object-oriented framework that lets anyone create original and complex games with thousands of objects on screen in just a few hours.
Flixel is licensed under the MIT license and the site has quite a few tutorials to get you started.
Flash Adventure Game Tutorial
series shows you how to create a
Flash adventure game with Flex and
ActionScript.
FlexFighters
shows you how to make a shoot'em'up
with Flex and ActionScript.
This is a tutorial series that shows you how to make a 3D Flash game with Flex and Away3D
A site that is basically all about using just pure AS3 and that now has game tutorials centered around his pure AS3 game making library is www.actiontad.com.
Your games may be smaller using only AS3 and the SDK, but you loose the ability to animate with a timeline, animations made with the timeline in Flash will perform better, than say sticking a whole bunch of .pngs together, which is a technique actiontad uses, but that site is coming into it's own now with the library he recently released, if pure AS3 game making is your thing it's worth a look.
If you want to deploy your games on mobile (iOS/Android) you should take advantage of Starling (http://gamua.com/starling/), 2D rendering engine built on top of Stage3D, which gives you GPU raw power.

Resources