The Essential Guide To Flash Games

Want To Learn To Create Games In Flash AS3? Our book,

The Essential Guide To Flash Games
Building Interactive Entertainment with ActionScript

Can help you


Buy It Now!

 

Buy E-Book Version

  • 12 Thrilling Chapters
  • 10 Full games in AS3
  • Make games in both the Flash IDE and with the Flex SDK
  • Build a reusable game development framework
  • Order a hard copy here
  • Order the E-Book here
Play The 10 Games In The Book

Other Free Tutorials That Can Help You Developing Games (it’s like a whole other book...for free!) (These ARE NOT in the the book)

0saves
  • Pingback: The Essential Guide To Flash Games Conspiracy? | 8bitrocket

  • Pingback: No More Corporate Teat – #3 – The First Day | 8bitrocket

  • Michael

    where can I find the Chapter 2 files?

  • 8bitrocket
  • bv

    I just ready your free chapter. It's amazing and refreshingly thorough while covering information that's immediately useful. You should have a game workshop sometime in LA.

  • 8bitrocket

    Where did you read it?

  • Martin

    Hi.
    I like your book so far (I´m just in the middle).
    I would really like to discuss some things.
    Would be nice to have a little forum, could also help to spread this book.

  • Zack

    When I try and run the FLA file of No Tanks in Flash IDE CS3, I get these 5 errors, all in Main.as:
    Line 16 , 1017: The definition of base class GameFrameWork was not found. Line 46, 1020: Method marked override must override another method. Line, 110 1020: Method marked override must override another method.Line 115, 1020: Method marked override must override another method. override public function systemNewGame():void { Line 1, 5000: The class ‘com.efg.games.notanks.Main’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.

  • Anonymous

    I’ve got Jeff looking at it. It sounds like a configuration problem. All of this was tested in CS3.

  • http://www.8bitrocket.com 8bitjeff

    It’s got to be the class path. Do you have the classes/ path included?

  • Frustrated

    Has anyone tried working through this book using Flash Builder 4?

  • dereki

    Dear 8bitrocket,
    After getting the code in chapter 2 working I went next to chapter 4, Flakcannon, and downloaded the files into a new project. I am using the free FlashDevelop/Flex3 system on Windows 7. I have a problem with the assets.
    In the book p.144 the instructions are,

    ”To use those (assets) in the Flex version we have to simply publish the SWF (with a new name, flakassets.swf) and place it in an assets folder in the src directory of our FlashDevelop/Flex project (src/com/efg/games/flakcannon/assets).”

    What does it mean to ‘publish’ the SWF in FlashDevelop?

    I put the downloaded ‘assets’ folder in the above path, hit ctrl Enter, and the compiler gives me Adobe actionscript error 1065, variable not defined, for each asset. Looks like the compiler can’t find them.
    Inside the assets folder, with the actual .gif and .wav files, is flakassets.swf. Is this the ‘published’ file? I right click this .swf, click add to library, and still no luck. Have I put the assets in the wrong place?

    Any help is great appreciated

    • http://www.8bitrocket.com 8bitjeff

      Steve wrote the Flash IDE version of the game first and then re-wrote it slightly for Flash Develop. It needs the swf file of assets from the Flash IDE. It is included in the download. Steve will take a look and point you in the right direction. I have all of these compiling fine with Flash develop so it might just be a location problem with the folder.

      • dereki

        Dear 8bitjeff,
        I thought of a workaround for my difficulty using the assets in chapters 4 & 5 Flakcannon. Reading chapter 10, I like the idea of being Flash IDE free like you talk about on page 427.
        1) I convert the flakcannon .wav files to .mp3
        2) I place the .mp3 files and the .gif files into the assets folder.
        3) I place the assets folder inside the flexSDK folder as per directory structure on page 429.
        4) I take out all of the Embeds and put them into a Library.as file.
        5) I change the Embeds (for example)
        from
        [Embed(source = "assets/flakassets.swf", symbol = "PlaneGif")]
        private var PlaneGif:Class;
        to
        [Embed(source = "../../../../../assetsplane.gif")]
        public static const PlaneGif:Class;
        6) I add Library.as to the flakcannon project tree.
        7) I hit ctrl Enter and in my imagination the build succeeds and I get Flakcannon running.

        Will this work? I will try it this weekend, but if it is wrong I would rather you let me know so I don’t go on a wild goose chase
        thanks

        • http://www.8bitrocket.com 8bitjeff

          That should work fine. The chapter 10 method is my preferred method of using external assets in a game.

          • dereki

            Dear 8bitjeff,
            With a little agonizing I was successful in getting Flak Cannon working!! Thank you for some great code. My problems with using .swf for assets were worth it, because using the chapter 10 method now I can roll my own assets, as you say IDE free.
            You can have my altered code if you like, as it now makes chapter 4 & 5 Flak Cannon plug and play for pure FlashDevelop/Flex3 developers, as long as they follow the chapter 10 directory structure.
            My only problem outside of your code for the assets, was to realize I had to go into FlashDevelop to
            Project->Properties->Compiler Options and change static link RSL from false to true, click Apply, and click OK!! This was essential in getting the program to run.

            Again, thanks for some great code. You guys have made a really cool book. I will be spending the next few weeks monkeying around with your code, changing things, teaming up with an old artist friend to make our own game.

  • Pingback: SydLexia.com – Site News and Random Shit » Blog Archive » I won a free Wii game!

  • Anonymous

    Dear 8bitrocket
    I was working through chapter 4 of your book when it hit me I hadn’t checked out what Flakcannon was like. I launched the SWF included with the download but when the first flak I fired exploded the Flash player crashed. I’m using Adobe Flash Professional CS5, Flash Player 10 and Windows 7.

    • Anonymous

      You need to upgrade to the newest newest version of Flash Player 10.1. Adobe has a reoccurring bug with the BitMap collision detection routines.

      • Anonymous

        Hey I tried installing Flash Player 10.1 but it still crashes. I get the error “Adobe Flash Player 10.1 r52 has stopped working”. Also the following error appears in a message box.

        An ActionScript error has occurred:

        TypeError: Error #1010: A term is undefined and has no properties.
        at com.efg.games.flakcannon::FlackCannon/removeItemFromArrayByIndex()
        at com.efg.games.flakcannon::FlackCannon/cleanUpLevel()
        at com.efg.games.flakcannon::FlackCannon/checkforEndGame()
        at com.efg.games.flakcannon::FlackCannon/runGame()
        at com.efg.framework::GameFrameWork/systemGamePlay()
        at com.efg.framework::GameFrameWork/runGame()
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()

        This error seems to only occur when the following happens:

        1. A ship is destroyed by an enemy plane.
        2. A enemy plane then reaches the bottom of the screen because of the gap left by that ship.
        3. The remaining ships are destroyed.

        • http://www.8bitrocket.com 8bitsteve

          OK, I’m going to need some time to check this one out. I don’t have Windows 7 on any machines yet. Sorry about this. It seems like 10.1 has some odd incompatibilities. I wonder if the introduced the old 10.1 bug from the Mac into the Windows 7 version.

          Can you tell me if this one works:
          http://www.8bitrocket.com/2010/03/16/flak-cannon-essential-flash-games-book-demo-2010/

          • Anonymous

            Yes that version works fine for me. (There is a bug by the way. If you have 4 ships and 3 of your ships are destroyed, you won’t be able to see your last ship until the next level). Also occasionally a pop up box occurs with the message “No register application for this extension” (I’m using Opera) but this didn’t stop the game from working.

          • http://www.8bitrocket.com 8bitsteve

            That’s not a bug actually, it works just like Missile Command, except Missile Command end s the level immediately. It’s noted in the book.

          • Anonymous

            Ah ok, I look forward to reading the rest of the book. I’m a student that’s setting up his own flash games company for about a year.

          • Anonymous

            OK, I have confirmed that this now does not work again in the stand-alone player. However, please test it outside of the Flash IDE in the published HTML page, or by right-clicking on the .swf and running it in a browser. It should, at least, load-up and not die right away.

          • Anonymous

            I tried running the SWF in Internet Explorer, the game ran fine for a little while and then my score just started increasing at a stupid rate. At this point only the bonus plane would spawn. I think I had something like 51 ships and still on level 1.

          • Anonymous

            Btw I checked the file link you posted on the adobe forum and it links to http://www.8bitrocket.com/book.flakcannon_help.zip with the following information:

            Not Found

            Apologies, but the page you requested could not be found. Perhaps searching will help.

          • Anonymous

            Fixed

          • Anonymous

            This is the one you created with CS5, right?

          • Anonymous

            Yes that’s right

          • Anonymous

            I just created this new FlakCannon.as class that removed the bitmap data hit test and replaces it with a regular hitTestObject(). Can you try to use this one:
            http://www.8bitrocket.com/book/flakcannon.as.zip

          • Anonymous

            It works fine now.

          • Anonymous

            Great. that means it’s that hitTest with bitmaps and hopefully Adobe can help. One question. Where did you get that original FlakCannon.as file?

          • Anonymous
  • Pingback: Announcing the 8bitrocket 16K Retro Re-make Contest | 8bitrocket

  • Pingback: Atari 16K Retro Remake Contest Nears Final Date | 8bitrocket

  • Pingback: Flash Game Development Tutorial Getting Started | tutorials blogs

  • Pingback: 10 Realistic Development Goals for the New Year | Freelance Flash Games News

  • Anonymous

    I commented the other day that I was having trouble in Chapter 2 of The Essential Guide to Flash Games. So, today I went through and retyped everything in and now I no longer get the 2032 stream error I was getting when I go to test movie in FlashDevelop and so that is good. The bad news is that I still can’t get the game to work. I get an swf file, but it is just a blank light blue screen. I tested it outside of the Flash Develop environment and it is still just a blank light blue screen, but with a small right box in it. When the box is clicked it disappears, but clicking more times does nothing.

    I case my project folder pathways are the trouble Here is what I’ve got:

    source/projects/stubgame/flexSDK/bin
    lib
    obj
    src/com/efg/games/stubgame
    Inside the stubgame folder there are 3 files:
    Main.as
    StubGame.as
    Main.mxml

    Is this the way these are supposed to be set up?

    If you don’t think it is my pathway then is it something in my code? Because I was having so much trouble I downloaded the code for your book and copied and pasted that into my files. I didn’t see any code for the Main.as and the Stubgame.as and so I typed that out myself and saved it in the pathway shown above.

    I’ve got 10 classes
    BasicScreen.as
    CustomEventButtonId.as
    CustomEventLevelScreenUpdate.as
    CustomEventScoreBoardUpdate.as
    FrameWorkStates.as
    Game.as
    GameFrameWork.as
    ScoreBoard.as
    SideBySideScoreElement.as
    SimpleBlitButton.as

    set up in the folder structure you outlined in the book. Am I missing a class?

    I am not an experienced programmer and am new to actionscript 3 and the flash develop environment, but I did take programming in C in college and got an A and so I’m not totally new to programming. However, I’m new enough that I might miss a typo in the book (or in my own typing of the code) that more experienced programmers might catch. I don’t want to give up, but I’ve already spent a long time on this and don’t know what to do next.

    The game builds just fine. The problem is that there is nothing there in the swf other than a light blue background.

    Thanks

    • Anonymous

      ASR,

      I will get Jeff to look at this today. It must be something simple going on.

      -Steve

  • Anonymous

    Thanks Steve. I’m thinking that it is probably something in my code, but I’m not sure what it is. I think if I ever get the game framework up and running that I’ll be able to figure out problems in the games in the rest of the book myself. I would’ve started with a book for beginners to Actionscript 3 and flash, but your book is the ONLY book I know of that tells game programmers how to program games with Flashdevelop and the FlexSDK. All other game programming books assume you have several hundred dollars to buy the Flash program.

    • http://www.8bitrocket.com 8bitjeff

      Hi, sorry it has taken me a while to get to this. You can delete the Main.mxml file if you want (it is not needed). Also, so can start a “AS3 Project” instead of an AS3 Flex Project to be sure.

      Can you zip up your files and send them to jeff[at]8bitrocket[dot]com? That way I can take a look and get you back all of the fire working properly.

    • Anonymous

      Of course we also assume you have $40.00 to buy a book! Oops! :)

  • Anonymous

    Hi Steve and Jeff,

    I retyped my code in or at least checked the code with what is in the book for errors and zipped it up and sent it off to Jeff. I really appreciate the offer to look at my code. I’m still getting the blank blue screen in the swf. At least I’m getting somewhat familiar with Actionscript 3 from all of the typing :)

    Even though I’m having trouble I still think the book was worth it because I am learning some stuff about game logic and the FlashDevelop environment itself. If you do a search online for developing games in FlashDevelop you’ll find a lot of people looking for tutorials and instruction on how to develop flash games with it. As far as I know, your book is the only one that uses FlashDevelop to create games.

    Your book also suggested that Actionscript 3 newbies get another beginner book and I did. I got one of the books you suggested in your book:
    Game Design with Flash by Rex van der Spuy. I read that book before I even started trying to program with yours, however, I couldn’t do much with it because it was designed for a different programming environment than what I’m using. Still, it was a useful resource.

  • Anonymous

    Hello,
    I have a weird question but I was trying to make a game based a lot on flak cannon and I can’t get my player icon to respond to to the keyboard without first pressing the mouse button. I was wondering if it was a problem in the game framework somewhere and if anyone else has heard of a problem like this. Thanks, Bill E.

    • Anonymous

      Bill,
      I have not heard this one yet. However, it sounds like an issue with focus and the web browser. Do you have any other mouse clicks before the user starts playing? Also, have you tried the wmode=window parameter in the Flash embed in the HTML?

    • Anonymous

      Bill,
      I have not heard this one yet. However, it sounds like an issue with focus and the web browser. Do you have any other mouse clicks before the user starts playing? Also, have you tried the wmode=window parameter in the Flash embed in the HTML?

      • Anonymous

        Thanks for replying. I don’t have any other mouse clicks before the user starts playing. I created it in Flash on a Mac and created a projector file for it to use on Windows and it does the same thing in Windows. I haven’t tried the wmode=window parameter in the Flash embed in the HTML, how would I go about that? Thanks, Bill E.

        • Anonymous

          So, is this happening in a projector, or when it is in a web page?

          • Anonymous

            It happens in flash player when I test movie, also in the projector. I haven’t been able to figure why.

          • Anonymous

            I just got it working by trying to create it after No Tanks! instead. I used the this.focusRect = false; and stage.focus = this; I don’t even know why this works but I’m glad it works now. Maybe if you have time you could tell me why it works or I could just research it on my own. Thanks for your replies. -Bill

  • Anonymous

    dear 8bitjeff,
    I’m taking a breather from your book to write to you because I have finished with chapters 4&5 flakcannon and I would like to share my efforts with you and your readership.
    Let me first say again, wonderful book!
    Something you have not emphasized enough though is the absolute importance of the Artist. I was lucky in that a childhood friend of mine was both a talented artist and interested in colaborating on this project.
    I would like to offer our version of flakcannon for your enjoyment and examination.
    My code is essentially grafted on top of the flakcannon code so it should be understandable. Here is a list of the changes and additions made:
    1)Changed the perspective, via the artwork, from top-down to side-to-side.
    2)Made it full screen 800×600
    3)Changed Title and Instructions screen to show graphics
    4)Changed simple button to picture button
    5)Put all assets into a Library.as file
    6)Added a high score vis a local shared object
    7)Use custom static sprites and animated sprites sized 100×200 and larger
    8)Altered Ship.as code now shows my sprites rather than one ship
    9)Combined Explosion.as code with Bonus_Plane code to creat a moving exploding subway car.
    10)Fiddled with alpha to blend custom blowgun animation with enemy sprite animation.
    11)Added sound tracks
    12)Changed Flak.as code to create continuously animating sprites
    13)Lengthened wait time for Level transition

    How can I send the game and source code to your site? Please let me know.

    I have to ask you about TILES. I have a big problem with tiles because they impose a burden on my ‘Artistic Director’ who would much rather just draw without the constraints that tiles impose.
    Are tiles really essential to game programming? Or are they a historical artifact from a time when CPU performance was much more limited? Could you please tell me roughly what the memory overhead would be if I used a 1600×1600 bitmap scrolled via scrollRect instead of like in Driveshesaid using a 128×240 tilesheet to create a 1600×1600 world.
    I learned all these cool programming and animation techniques from flakcannon. I would like to use this knowledge inside a large scrolling world rather than relearn everything to do the background and animations with tiles. Put simply, I want to be able to scroll flakcannon! Is it possible? If it is, can you point me in the right direction?

    Hope you like what we did to your flakcannon.

    dereki1

    • Anonymous

      Dereki1,

      Send the files to info@8bitrocket.com. We’d be happy to showcase your game.

      -Steve

  • Pingback: The Essential Guide To Flash Games Made a Profit! (really) | 8bitrocket

  • Pingback: The HTML 5 Canvas (O’Reilly) Table Of Contents | 8bitrocket

  • http://pulse.yahoo.com/_XJZ65FMZXKBVRCCKIYQGN4IUAM Anonymous

    Hi,

    First, love the book and so glad that it is not a “Flash Only” book. Flash still confuses me so I stick with Flexbuilder (Flashbuilder).

    One recommendation. In the flash code, or the docs somewhere, can you add a line?

    here is the header for the code in chapter 6 that makes the code show me the entire image. Without it, part of the image was being cut off..

    [SWF(width="640", height="480", backgroundColor="0xffffff",frameRate="30")]
    So, using your code same:

    package com.efg.games.notanks{ import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.geom.Rectangle; import flash.geom.Point; import com.efg.framework.TileSheet; /** * … * @author Jeff Fulton */        [SWF(width="640", height="480", backgroundColor="0xffffff",frameRate="30")] public class GameDemo extends Sprite {

    Thanks again for a great book!

  • Pingback: Iteration 4 Complete : Vladimirsan