Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Reuse your Flash games code – exclusive code Vs recyclable code

This is ideally the sequel of reuse your Flash games code (as much as you can!) post.

If the post I wrote about two months ago is almost pure theory, here I am with some numbers which can show you the importance of reusing your code.

I made two games using a set of libraries which I can reuse with no hassle. The first is Stringy, and it will be released this week, at the moment it’s in last call on Flash Game License. The second is Slingy, and it was submitted today for bidding, always on Flash Game License of course.

The first is some kind of mouse avoider with a twist, while the second is a fire and collect physics game. Two completely different gameplays. You can check the video teaser here. So what kind of code can I reuse? Obviously, all menu management, API connections, low level achievement routines, and everything which is not strictly part of the game itself.

But I think it’s time to show you some numbers.

Stringy has been coded with 929 lines, but if we exclude everything which is not strictly related to gameplay, we remain with only 424 lines. This means only 45.6% of the code cannot be reused, unless I plan a sequel. The remaining 54.4% has been used to create Slingy, 1179 lines of pure awesomeness, but only 720 have been written from scratch.

In other words, my second game just needed 61.1% of the effort I needed to put if I decided to code it from scratch. And less effort means less time, which obviously means more games and more money.

Now, while I am waiting for billionaire bids on FGL, I am making my first StencylWorks game, but I am also creating some kind of framework into framework to minimize the effort needed to make a game.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (13 votes, average: 3.77 out of 5)
Loading...Loading...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 4 comments

  1. Chris

    on December 13, 2011 at 9:04 am

    The guys over at 8bit rocket have a book out, but it also goes through building a game framework. (The Essential Guide to Flash Games)

    I started awhile ago, and really need to set it up so I can copy most of the code from AS3 into Java, or the other ways around.

    But game frameworks do help a lot- from basic sprite structures to replace movieclips (using blitting instead), sprite managers, and just handling the repetitive stuff, that you always need to have, to have a basic game.

  2. Ziro

    on December 13, 2011 at 6:01 pm

    Hey.

    @Chris: “Boilerplate” code is the term you are looking for. (:

    _______________________
    – Ziro out.

  3. Alice

    on December 14, 2011 at 5:04 pm

    Thoughts: I don’t think you can equate the number of lines to the amount of work done. The code that implements the gameplay is usually more complex and thus requires more time to write than that of menus and other trivial coding.

    Good overall message, though.

  4. Yuri

    on December 22, 2011 at 4:05 am

    I don’t want to sound condescending but as a professional programmer 1000 lines of codes is totally insignificant. I have 20000+ lines of codes in my flash game and it’s far from finished.

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×