A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: [Tutorial] Simple Game From Begining to End

  1. #1
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352

    [Tutorial - AS2] Simple Game From Begining to End - Updated 06/30/06 - #2

    Hi all; I've gone ahead and put together a simple tutorial on how to make a game from begining to end. It focuses much more on technique then on performance but it does show all the basics. I've broken it down into eight major sections thus far with more on the way.

    Stage 1: Facing the Mouse
    Stage 2: Following the Mouse
    Stage 3: Shooting
    Stage 4: Enemies
    Stage 5: Collision Detection 1 - Mathematic
    Stage 6: Beautification
    Stage 7: Refinement
    Stage 8: Guns Galore!
    Stage 9: Enemies Shooting
    This covers many basic questions like how to orient a clip to the mouse, how to follow the mouse properly, how to animate a projectile on an angle, how to collide that projectile with something, pausing, etc. Feel free to let me know if you run into anything you want or need. Thanks!

    Updates:
    06/26/06 - Added in stage 6. Basically this involved dropping some images into the game and fixing a bug in both stage 5 and 6. It looks like I'll be making quite a few more stages. The next one will involve the enemies shooting and a general enhancement of their AI.

    06/28/06 - Added in stage 7. I decided the game is kinda fun and worth a little extra oomph so rather then rushing to close everything out, I decided to step back and tune things. I've changed how the controls work a bit to be both smoother and more realistic-feeling. I tweaked some of the variable names and comments to be more accurate and easier to follow. I added in a pause command (use the "p" key while playing) as a first step in making it a real game. I also added in the concept of a shield and gun energy. The gun energy drains as you shoot and recharges over time. The shield just charges up. Once the enemies can hurt the hero, this will become animated and look better.

    06/30/06 #1- Added in "gun modes". This lets you change how the four guns on the ship fire. Oh yeah, added in four guns to replace the one that has been there all along. You can now fire with four different modes, "single", "dual", and "quad". Each mode has a different cooldown and energy drain rate based on the number of guns firing. You change the gun mode by using the "m" key while playing. Please give it a shot and let me know what you think!

    06/30/06 #2- Added in the ability for enemies to shoot, the hero ship to be hit and take both shield and hull damage. I also tweaked the bullets look and speed.

    -=-=-

    WilloughbyJackson has graciously provided me with some sound effects and graphics that I will add to the game. Looks like explosions and the like are in
    Last edited by webgeek; 06-30-2006 at 03:05 PM.

  2. #2
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Very, cool webgeek. Im sure this will help many people. Nice work

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Good stuff, added already into Knowledgebase.

    Mike, would you mind mentioning the Flash version and/or AS version used in tutorials so people can know if they are able to use the source fla before downloading it?

    I dont know if you plan to continue the tuts, but there is obviously need for next part, where enemies collide with hero, you lose a life and once you have no more lives the game ends. You would be surprised to see how many people have trouble ending the game.

  4. #4
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Wow, very simple and its exactly what new Flash Game Devs should be reading. I think that it is top notch, now we just have to convince them to read that first before asking how to make a RPG...

    Again, awsome.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  5. #5
    Member
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    93
    yea where good stuff youre tutorial ! very nice.
    so how do I make an rpg
    nah to be serious now so very good stuff webgeek keep it up

  6. #6
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Mike, would you mind mentioning the Flash version and/or AS version used in tutorials so people can know if they are able to use the source fla before downloading it?
    Oops, I didn't think about that. Good idea. I've been using AS2, minus the classes for these examples but it looks like lots of people are still on AS1. I might need to switch to AS1 to make these more accessible.

    I dont know if you plan to continue the tuts, but there is obviously need for next part, where enemies collide with hero, you lose a life and once you have no more lives the game ends. You would be surprised to see how many people have trouble ending the game.
    I wasn't sure I should continue, I guess I will. I didn't expect that many people to have problems finishing up. I'll go ahead and all at least one more stage and maybe a second. Then it will be a fully working game.

    Everyone else: Thanks for the kind words. If you see anything you'd like changed, please let me know!

  7. #7
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Oops, I didn't think about that. Good idea. I've been using AS2, minus the classes for these examples but it looks like lots of people are still on AS1. I might need to switch to AS1 to make these more accessible.
    Isnt AS1 compaired to AS2 without OOP preaty much identicle?
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  8. #8
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Added Stage 6: beautification. Read the first post for details.

    Gloo Pot: Yes, pretty much. I'm using strongly-typed variables everywhere. That's about it for AS2. It's time people migrate though so I don't plan on porting this to AS1.

  9. #9
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Oh ok, so the only real differeance will be when you use OOP? Just a off topic question, can you create classes and stuff inside the original FLA or can they only be created in AS files. I know your probably thinking go test that your self, but i dont know oop so i would know how to.
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  10. #10
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Flash expects AS2 classes to be in their own files. As for OOP, the game doesnt use it just to keep things simple. Normally I would use objects heavily, but I didn't think it would work to cover that AND game coding in one fell swoop.

  11. #11
    Senior Member The Helmsman's Avatar
    Join Date
    Aug 2005
    Location
    _root
    Posts
    449
    Great job!

  12. #12
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    noobs shall be very pleased

    nice work
    lather yourself up with soap - soap arcade

  13. #13
    Senior Member
    Join Date
    Apr 2005
    Posts
    467
    Cool.

    Dont have much time now to go through it but I was trying to do something similar for a year now. So yeah if you need some help, I am your man (mental note: rephrase that later).

    And yeah it will avoid a lot of (the same) questions here.

    I will do it from Flash 5 not to let anybody down.
    Again it's about teaching the technique and the way it work, and the way of thinking it. Giving tools and not just code.

    Cool!

    coffee now...
    Hope nobody knows I am still on Flash 5
    ______________________________________
    All artists are prepared to suffer for their work
    but why are so few prepared to learn to draw?(Banksy)

  14. #14
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Very cool, can't wait to try some of them out.

  15. #15
    Member
    Join Date
    May 2006
    Location
    Michigan
    Posts
    99

    You are the man with the plan

    Very nice you are a verr helpfull for newbs like me ... love that dude
    Jay

    The man with the plan !!!

  16. #16
    Member
    Join Date
    May 2006
    Location
    Michigan
    Posts
    99
    Is Beautification a word ...lol
    Jay

    The man with the plan !!!

  17. #17
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Glad it's been helpful thus far. I'll probably add something in tonight.
    Is Beautification a word
    Yup:
    http://wordnet.princeton.edu/perl/we...beautification

  18. #18
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Doh, been working on other things and only put a few minutes in on this. Tomorrow night there will be an update containing a lot of clean up. Specifically, I've renamed all the "gun" variables and functions to "hero" for readability. Addtionally, I've added in lots of refinements like a working pause system, weapon energy, and shield energy. Finally, I've added in some code to make the hero behave a bit better. You can't get it to face the wrong direction now, it doesn't snap to follow the mouse, it rotates with a set speed. This raises the challenge a bit. I'm going to refine the "follow the mouse" code a bit too. Like all projects, this has evolved over time. Originally I never intended to go beyond the 4th or 5th stage. I do plan on stopping soon though. Probably 3 more stages total and then I'm done. At that point, it will be a working game and not too shabby for a throw away, even if I do say so myself

    If anyone feels like giving me some sounds and artwork, Id appreciate it. I'd love explosions for the enemy ships and sound effects + music. If someone sends that stuff to me, I'll get them incorporated into the example. That will show how to do proper volume sliders and the like. Have fun!

  19. #19
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,352
    Ok, I updated it with a lot of clean up and some new code. Looks and feels much better now. Still lots to do but it's coming together and feeling like a real game. I figure a few more stages and it will be complete. As always, let me know if you have anything you want to see. Thanks!

  20. #20
    Senior Member The Helmsman's Avatar
    Join Date
    Aug 2005
    Location
    _root
    Posts
    449
    Yes, its much better. I can only suggest you to add some explosions when the enemy was hit and may be animate spaceship destruction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center