Sign in to follow this  
Melkon

C++ (SFML) and Flash player/Unity

Recommended Posts

Melkon    629

Hello!

Is it possible (if yes, how?) for a c++ (sfml) game to make compatible with flash player OR unity?

It is important because i can reach much more people through fp or unity. (for example i can promo it on kongregate.com etc).

 

Thank you for answers!

Share this post


Link to post
Share on other sites
SimonForsman    7642

Hello!

Is it possible (if yes, how?) for a c++ (sfml) game to make compatible with flash player OR unity?

It is important because i can reach much more people through fp or unity. (for example i can promo it on kongregate.com etc).

 

Thank you for answers!

 

No it is not.

Share this post


Link to post
Share on other sites
meeshoo    512

There is a slight chance you can reuse a part of  your code (game logic and stuff) by using them as plug-ins in Unity 3d Pro edition, but you'll still have to re - implement a big part of your game in Unity scripting (java script or C#).

Share this post


Link to post
Share on other sites
Melkon    629

There is a slight chance you can reuse a part of  your code (game logic and stuff) by using them as plug-ins in Unity 3d Pro edition, but you'll still have to re - implement a big part of your game in Unity scripting (java script or C#).

Well, i don't wanna change the language. Thank you!

Share this post


Link to post
Share on other sites

There is FlasCC which will allow you to write native code for use in Flash.  The Quake port basically just using the Flash framework for input and the entire game loop is in native code.  Whether or not it is worth the effort is up to you.  ActionScript 3 is a curly brace language, so unless you are using templates or advanced C++ extensively then porting "C with classes" type code would be pretty easy.

Share this post


Link to post
Share on other sites
Melkon    629

There is FlasCC which will allow you to write native code for use in Flash.  The Quake port basically just using the Flash framework for input and the entire game loop is in native code.  Whether or not it is worth the effort is up to you.  ActionScript 3 is a curly brace language, so unless you are using templates or advanced C++ extensively then porting "C with classes" type code would be pretty easy.

Thank you very much! A will take a look on it.

Share this post


Link to post
Share on other sites
kop0113    2453
FlasCC unfortunately still targets the unportable proprietary Flash stage system.

Emscripten could be perfect here. It is basically a C++ to Javascript compiler but also provides well known C++ media libraries such as SDL, OpenGL, SDL_mixer, SDL_image, Qt, glut etc...

My software always uses either SDL or Glut and OpenGL so it has been very easy to put out a web build. I highly recommend these technologies if you want to keep with C++ but also target the web (as well as every other platform under the sun ;)

https://github.com/kripken/emscripten

A few simple demos using the technology can be found at http://devio.us/~kpedersen/mutiny/doku.php?id=demos (apologies for the slow server) Edited by Karsten_

Share this post


Link to post
Share on other sites
Melkon    629

Emscripten could be perfect here. It is basically a C++ to Javascript compiler but also provides well known C++ media libraries such as SDL, OpenGL, SDL_mixer, SDL_image, Qt, glut etc...
FlasCC unfortunately still targets the unportable proprietary Flash stage system.

My software always uses either SDL or Glut and OpenGL so it has been very easy to put out a web build. I highly recommend these technologies if you want to keep with C++ but also target the web (as well as every other platform under the sun ;)

https://github.com/kripken/emscripten

A few simple demos using the technology can be found at http://devio.us/~kpedersen/mutiny/doku.php?id=demos (apologies for the slow server)

Whao, that's sounds amazing, i think it's the time to learn SDL. Thank you! :)

Share this post


Link to post
Share on other sites
kop0113    2453

Whao, that's sounds amazing, i think it's the time to learn SDL. Thank you! smile.png


smile.png

Luckily SDL also has some fantastic tutorials written by GameDev.net's own LazyFoo (http://lazyfoo.net/SDL_tutorials/). These should help you get started. For 2D games it covers pretty much everything.

As an added bonus, when compiled with Emscripten, your SDL games will actually be hardware accelerated because they use the web browsers HTML5 canvas underneath.

Share this post


Link to post
Share on other sites
kop0113    2453
Ah good point, it is worth mentioning that Emscripten provides SDL 1.x (and soon SDL 2.0). However, since the emscripten version of the SDL API has been tweaked to run in a mobile browser (i.e touch events) and is already 3D accelerated, it is likely to stick around for many years to come (and will almost certainly still outlive commercial proprietary products like Unity).

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

Sign in to follow this