Sign in to follow this  
Sean_Seanston

What's it like to start making Flash games coming from C++?

Recommended Posts

Thinking about trying my hand at making a Flash game and just wondering what that would entail. Naturally, having general game programming experience will always be a big help when programming games in any new language but what might the obstacles be when transitioning to Flash from C++?
I've also done some Java programming so I'm fairly familiar with that at least on a basic level, but no games so all my game experience is through C++.

I had a very brief glance over a few ActionScript tutorials today and it seemed from the little I looked at that it would be pretty accessible but then I barely scratched the surface.

Once you've gone over some tutorials and seen the basic structure of ActionScript, is it a relatively simple thing to apply the principles of C++ game development to ActionScript or is there quite a tricky learning curve?

Also, while we're at it... if anyone here started with C/C++ and tried Java games, what was that like? I'm quite interested in branching out to the more portable and "modern" languages/platforms, especially given their extensive use by the independent sector. Would be good practice and interesting too.

Share this post


Link to post
Share on other sites
Writing a flash game is much simpler than in c++ because flash already includes quite a few ingredients for a game. This however can be a double edged sword, if you are really accustomed to c++ like me you might find that actionscript lacks the more complex features of c++ which can be hard to use but are very useful.

as for your second question i have not tried Java but i have tried C#, I found that most of the differences were largely unnecessary and that all they did was confuse me.

Share this post


Link to post
Share on other sites
Flash is very different than C++ programming, but no more complex. It does require a somewhat different way of thinking, though.

1) Flash is much more limited in how you engineer your program: there are certain patterns it is designed for, and others that it really doesn't like. If you try to bend Flash to your will, you will fail. If you play nicely with Flash and work within its constraints, you'll do ok.

2) Flash "logic" feels really messed up if you're used to working in a function-oriented language. It's basically a big timeline, and game logic happens by jumping around between frames. It's a holdover from the fact that Flash started as an animation tool, and in my opinion it makes any game development in Flash feel like a dirty hack... but hack or not, that's how it is.

Overall, learning C++ was alot harder than learning Flash will be. My experience has been that I tried using Flash and just felt like using it to build a game was like trying to fit Shanghai into a shoebox, but your results may vary :)

Share this post


Link to post
Share on other sites
If your from a programming background my sugestion is don't make flash games, make flex games.
Flex is a stand alone action script compiler that will let you make a swf without flash.


flash develop is a free ide that works well for me.
[url="http://www.flashdevelop.org/wikidocs/index.php"]http://www.flashdeve...idocs/index.php[/url]

flixel is a game library for flex/flash, its a bit limited but very easy to learn.
[url="http://flixel.org"]http://flixel.org[/url]

Share this post


Link to post
Share on other sites
[quote name='JBourrie' timestamp='1307319274' post='4819917']
It's basically a big timeline, and game logic happens by jumping around between frames.
[/quote]

- Negative; that was a case a few years ago however.

To the OP: Look at Flex. Seriously.

Share this post


Link to post
Share on other sites
[quote name='Kaze' timestamp='1307321403' post='4819929']
If your from a programming background my sugestion is don't make flash games, make flex games.
Flex is a stand alone action script compiler that will let you make a swf without flash.


flash develop is a free ide that works well for me.
[url="http://www.flashdevelop.org/wikidocs/index.php"]http://www.flashdeve...idocs/index.php[/url]

flixel is a game library for flex/flash, its a bit limited but very easy to learn.
[url="http://flixel.org"]http://flixel.org[/url]
[/quote]

Yes, don't use Flash CS to make Flash games. Use Flex and actually code your games. It will be a much better end result, you can usually tell the games that were made all in CS as they just seem to be a bit off. ActionScript is a pretty nice OO language when you get around it quirks (C++ has more then its fair share of quirks). Of course you can't do intensive 3D games (Molehill will make this a little easier but still nothing crazy) but as far as 2D goes when using the Flex compiler then isn't much you can't do. If you go the Air route then you can make regular desktop apps as well.

Share this post


Link to post
Share on other sites
[quote name='Kaze' timestamp='1307321403' post='4819929']
If your from a programming background my sugestion is don't make flash games, make flex games.
Flex is a stand alone action script compiler that will let you make a swf without flash.


flash develop is a free ide that works well for me.
[url="http://www.flashdevelop.org/wikidocs/index.php"]http://www.flashdeve...idocs/index.php[/url]

flixel is a game library for flex/flash, its a bit limited but very easy to learn.
[url="http://flixel.org"]http://flixel.org[/url]
[/quote]

Big second on this. However, also worth mentioning an alternative for Flixel is [url="http://flashpunk.net/"]FlashPunk[/url], a really good library for writing flash games.

Share this post


Link to post
Share on other sites
just to help clarify..

flash is now at version 10 soon to be 11.

as3 is used predominantly now and has been for a while.

it supports a full OO style of programming and does it well, only missing out on a few features of say java or c# (enums, private constuctors etc..)

you don't have to use the flash IDE to create swfs. you can use notepad if you want and a free compiler. I recommend FlashDevelop if your on a budget or Flash Builder or FDT.

It is a very quick language to program in and you can get on screen results very very quickly.

It lacks a lot of the power and speed of other languages :( but this can usually be made up for by well structured code and the platform is getting faster with each release.

Flex, is a library for application dev mostly and wont be much to a game developer. (Flex builder 3 is not flex... hence the name change to Flash Builder).

Share this post


Link to post
Share on other sites
[quote name='bwhiting' timestamp='1307541981' post='4820930']Flex, is a library for application dev mostly and wont be much to a game developer. (Flex builder 3 is not flex... hence the name change to Flash Builder).[/quote]
This isn't really true. Two of the most common game libraries for Flash are based on Flex. Many game developers might not deal with a lot of the Flex classes personally but the libraries they use do.

Share this post


Link to post
Share on other sites
was trying to iron out any confusion between "flex" when people are referring to the ide and "flex" the framework.

interesting that it is used in game libraries, not for game elements I hope?
I suppose it could be used for ui... but for game ui is seems like overkill and more hassle to skin that it would be to just do manually.

Do you know what elements of flex they are using?! I can't think why it would be used given its pretty bloaty and slow.

Share this post


Link to post
Share on other sites
Well there are a few things about flash, more specifically speaking, action script, that coming from c++ might make you want to bang your head to a wall.

The first one, as was mentioned above, is that you come from a language that gives you a lot of power and freedom to a language that will laugh at any attempt to do something "different".

Second one is the garbage collector, coming from a c++ environment you would be used to be careful about your memory and explicitly clear it, the first memory related issue that will make you want to kill yourself is that having nulled everything does not necessarily clean the memory and when you explicitly call the garbage collector and asking it to clean up he will ignore you most of the time, there is actually a fairly know hack to force the garbage collector involving a loop network connection. (Yes, this is not a joke)

Another thing is the provided libraries, taking for instance the graphic object, at first you would think "oh goddie! they are giving me a graphic object with everything necessary already", and the more you use the thing you will begin to realize that you wanted a simple pencil and they gave you an autocad plotter, which is great for highly complex things but not for simply writing notes on a notepad.
Most of the libraries provided by flash already come with a lot of baggage that if you think object oriented, have nothing to do with what you are asking for.


I would advice you to start by using some of the libraries recommended above like flixel or flashpunk, since they allow you to jump into game development more quickly while avoiding to learn all the capricious ways of flash and action script.

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