Jump to content

Migration from AS3 to HTML5


gigbig
 Share

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.

Link to comment
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?

Link to comment
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. 

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...