gigbig

Migration from AS3 to HTML5

Recommended Posts

It is possible, but IFrames are not faster than doing all the stuff in one canvas. Each iFrame produces also a state change, so your game will always be slower than using no IFrames.

 

If you still want to go this path: you can communicate between these frames via normal javascript frame communication. However, please note that there are security policies applied when using IFrames which may prevent a communication, depending how you host your files.

Share this post


Link to post
Share on other sites

It is possible, but IFrames are not faster than doing all the stuff in one canvas. Each iFrame produces also a state change, so your game will always be slower than using no IFrames.

 

If you still want to go this path: you can communicate between these frames via normal javascript frame communication. However, please note that there are security policies applied when using IFrames which may prevent a communication, depending how you host your files.

 

Well, but doing everything in one canvas means to develop a single piece of software, right? What I need is a game made of different components dealing with each other and coded by different coders, so if I update one component I am updating all games (that could be more than 100), without the need to recompile everything everytime.

Is there an alternative way of doing what I need?

Share this post


Link to post
Share on other sites

Sure, use simple / external JavaScript libraries & interface definition. This enables you also to separate the components from each other as long as everybody uses the defined interface. If you just want to add a top layer, for example with ads, to your games, then it might be easier to add an Iframe. 

Share this post


Link to post
Share on other sites

Interfaces are necessary, imho.

Could DIVs be the right way of using components? A component in each DIV.

Can they communicate by JS calls? I don't have a clue on how to do this...

Share this post


Link to post
Share on other sites

I thought I am maybe missing the point: I don't have to put components in separate DIVs, I need a single application that loads others and renders them in the same canvas, is this possible? Same as a Flash SWF loading other SWFs to obtain assets and complete applications to run on the same stage.

Share this post


Link to post
Share on other sites

What about awe6? I think I have seen the site a while ago, but didn't remember about it and noone named it except you. Please tell me what you know about it. How does it interact with OpenFl? Are there native libraries for tweening? Does it handle incompatibilities with different browsers when targeting HTML5?

 

@gigbig sorry if I'm too late - but you can ask me anything about awe6, I'll probably know the answer.  In a nutshell it's just a framework (main loop, state machine, helper systems for inputs, preloader and sounds), but it hopes to encourage Solid code.

 

For HTML5 the rendering is done either by OpenFL or CreateJS (as preferred by the developer). I prefer CreateJS for the base because it's less JS to load and, in my opinion, is the more mature library.  I then tend to manipulate Canvas directly for advanced rendering engines (e.g. 3D, particles, etc) or use WebGL libraries.  Additionally the awe6 CreateJS driver includes some workarounds for common browser incompatibilities and has helpers for fullscreen modes, orientations, etc.

 

Main advantage over Haxeflixel or Haxepunk is it doesn't need OpenFL or any flash package legacy (same applies for Flambe) so can be easily mixed with other JS libraries.  Main disadvantage is that it's not designed for beginners, so you'll need expertise already and a big-picture reason to adopt it.

Share this post


Link to post
Share on other sites

@totor, sorry!  CreateJS and OpenFL libraries moved a fair bit in the last 3 months so we wanted to wait for a stable period.

 

Edit: awe6 public project has moved from googlecode to github (and received some TLC) with an updated haxelib release.

Share this post


Link to post
Share on other sites

Hi,

 

I can recommend you my own library ivank.js ( http://lib.ivank.net ), which I made for myself in order to rewrite my AS3 games into Web with minimum effort. You don't have to know any HTML, CSS or DOM. And there are some extra features, which are not present in flash (e.g. Graphics.drawTriangles3D()).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.