Author Topic: Using Flixel with haXe?  (Read 3005 times)

hima

  • Member
  • **
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • My Dev Blog
Using Flixel with haXe?
« on: Tue, Nov 10, 2009 »
Has anybody tried this yet?

If it's possible, please share your knowledge and tell us how to do it. Thank you!  :)
« Last Edit: Tue, Nov 10, 2009 by hima »

PlayOrDie

  • Active Member
  • ***
  • Posts: 151
  • Karma: +0/-0
  • Game Over
    • View Profile
Re: Using Flixel with haXe?
« Reply #1 on: Sun, Nov 15, 2009 »
I think in principle you can use almost any other Actionscript 3 based library/set of tools/framework (delete as appropriate).

All it takes I guess is a thorough understanding of the classes that you are trying to use with Flixel, and a thorough understanding of Flixel itself.
 
I have been on the HaXe website, and have to say I found its lack of documentation, and general presentation rather disappointing for such a hyped product.  Correct me if I'm missing something though.

:)
Make it work reliably and fast.
Donald Lebeau - Gauntlet

L_O_J

  • Member
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: Using Flixel with haXe?
« Reply #2 on: Sun, Nov 15, 2009 »
Has anybody tried this yet?

If it's possible, please share your knowledge and tell us how to do it. Thank you!  :)
It is possible, if what you want is straight port from AS3 to haXe, it's not too hard, I personally never tried it myself, but a friend of mine succeeded in porting flixel to haXe, even the Mode example too, using SamHaxe to handle the preloading. Just watch out with the type, and use casting where needed :P. Personally I think it rather pointless in porting flixel to haXe for the sake of using flixel in haXe, If I, someday, port flixel to haXe, I would probably rewrite some of the internals, to use haXe feature(s), such as generic type, inline, etc, rather than one to one port.

I think in principle you can use almost any other Actionscript 3 based library/set of tools/framework (delete as appropriate).

All it takes I guess is a thorough understanding of the classes that you are trying to use with Flixel, and a thorough understanding of Flixel itself.
 
I have been on the HaXe website, and have to say I found its lack of documentation, and general presentation rather disappointing for such a hyped product.  Correct me if I'm missing something though.

:)

haXe is not *THAT* hard/different than AS3, for comparison, a friend who ported flixel as I mention earlier ? he is still in highschool ;). haXe documentation is rather hard to find I agree, I've been following and using haXe on/off since last year. But trust me, the current documentation is way better than back then, and it still improving. Integration with FlashDevelop is better than ever. The compiler is crazy fast too. Just create an haxe flash project, and start from there, the Flash API is pretty much the same.

hima

  • Member
  • **
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • My Dev Blog
Re: Using Flixel with haXe?
« Reply #3 on: Sun, Nov 15, 2009 »
Thank you so much both of you :D

I have been wanted to start learning on haXe for quite sometime but never got my  hand to it due to it lacks of good tutorial and good documentation like you guys said.  I could only find simple example, but there is no intermediate level or advance stuff, so I don't know how to continue :S

The reason I wanna try haXe with flixel is because I've heard that swf compile with haXe is faster than the one compiled by AS3.  And also you can compile it to C++ executable file. L_O_J, have you friend tried this? You said the compile time is fast but what about the speed during execution?

I see your point about porting flixel to haXe being pointless. I take it that many haXe features are better and faster than actionscript?

L_O_J

  • Member
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: Using Flixel with haXe?
« Reply #4 on: Mon, Nov 16, 2009 »
Well first thing first, haXe will not automatically make your swf faster, not if you don't use the toolset/feature that haXe give you. A direct port from AS3 -> haXe will probably run at the same speed, or even slower. Like I said before, if you don't remodel you code structure to take advantage of haXe features, such as inlining, alchemy byte code, etc, you probably won't notice any improvement.

And haXe feature is not only about speed only, it also generic type which something like c++ template, which saves you a lot of writing the same class structure (but with small difference or working on different type) all over again. And with enum and generic type you can play with some metaprogramming.

haXe also have type inference, in a nutshell, the compiler will guess the type of the variable you declare, and provide type check for it. So even if your code is not strongly typed, it will get the benefit of type check.

There is not much doc for haXe Flash target, simply because, most of the API are the same, you can even use the Adobe documentation alongside haXe language reference to code haXe flash swf.

Lasty, I think you might want to read Nicolas Cannasse Blog (http://ncannasse.fr/) and haXe website (and forum) www.haxe.org and I strongly advise you to join haXe mailing list (look at the link in the webiste).

L_O_J

  • Member
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: Using Flixel with haXe?
« Reply #5 on: Tue, Dec 15, 2009 »
Sorry to bump an old thread, but it seems that my friend finally release the code in haXe forum.
http://haxe.org/forum/thread/665
AFAIK it's based on the old 1.2x Flixel