To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Games

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-24-2006, 08:32 PM   #1
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
[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
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum

Last edited by webgeek; 06-30-2006 at 04:05 PM.
webgeek is offline   Reply With Quote
Old 06-24-2006, 11:29 PM   #2
hooligan2001
Who needs pants?
 
hooligan2001's Avatar
 
Join Date: Apr 2001
Location: Somewhere
Posts: 1,975
Very, cool webgeek. Im sure this will help many people. Nice work
__________________
www.howtoit.com
hooligan2001 is offline   Reply With Quote
Old 06-25-2006, 05:43 AM   #3
tonypa
Moderator
 
tonypa's Avatar
 
Join Date: Jul 2001
Location: Estonia
Posts: 8,138
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.
__________________
My games, Tile based tutorials, Vectors, Latest finished game Ononmin
tonypa is offline   Reply With Quote
Old 06-25-2006, 06:14 AM   #4
Gloo pot
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!
Gloo pot is offline   Reply With Quote
Old 06-25-2006, 06:54 AM   #5
Gorfiuz
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
Gorfiuz is offline   Reply With Quote
Old 06-25-2006, 11:39 AM   #6
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
Quote:
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.

Quote:
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!
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-25-2006, 10:49 PM   #7
Gloo pot
Senior Member
 
Gloo pot's Avatar
 
Join Date: Aug 2005
Location: Australia Mate!
Posts: 874
Quote:
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!
Gloo pot is offline   Reply With Quote
Old 06-25-2006, 11:03 PM   #8
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
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.
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-25-2006, 11:35 PM   #9
Gloo pot
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!
Gloo pot is offline   Reply With Quote
Old 06-25-2006, 11:39 PM   #10
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
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.
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-26-2006, 05:23 AM   #11
The Helmsman
Senior Member
 
The Helmsman's Avatar
 
Join Date: Aug 2005
Location: _root
Posts: 449
Great job!
__________________
LiveBroadcasting | FrozenModule
The Helmsman is offline   Reply With Quote
Old 06-26-2006, 05:29 AM   #12
mr_malee
M.D.
 
mr_malee's Avatar
 
Join Date: Dec 2002
Location: Shelter
Posts: 4,039
noobs shall be very pleased

nice work
__________________
lather yourself up with soap - soap arcade
mr_malee is offline   Reply With Quote
Old 06-26-2006, 06:29 AM   #13
artlink
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)
artlink is offline   Reply With Quote
Old 06-26-2006, 10:35 AM   #14
walsher
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.
walsher is offline   Reply With Quote
Old 06-27-2006, 11:24 AM   #15
Jay2391
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 !!!
Jay2391 is offline   Reply With Quote
Old 06-27-2006, 11:25 AM   #16
Jay2391
Member
 
Join Date: May 2006
Location: Michigan
Posts: 99
Is Beautification a word ...lol
__________________
Jay

The man with the plan !!!
Jay2391 is offline   Reply With Quote
Old 06-27-2006, 08:42 PM   #17
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
Glad it's been helpful thus far. I'll probably add something in tonight.
Quote:
Is Beautification a word
Yup:
http://wordnet.princeton.edu/perl/we...beautification
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-28-2006, 12:38 AM   #18
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
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!
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-29-2006, 01:40 AM   #19
webgeek
Senior Member
 
webgeek's Avatar
 
Join Date: Sep 2000
Posts: 1,339
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!
__________________
Michael Grundvig
Electrotank, Inc.
http://www.electrotank.com
mike@electrotank.com
ElectroServer 4 multi-user server - forum
webgeek is offline   Reply With Quote
Old 06-29-2006, 05:15 AM   #20
The Helmsman
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.
__________________
LiveBroadcasting | FrozenModule
The Helmsman is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > General Help > Games

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:30 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.