Vertical scrolling game [ April 07, 2005 ] by Lars A. Doucet
The author of Dragon Pants 2 has released this game under a Creative Commons license. Download the source code to learn how to develop a vertical scrolling shoot'em'up.
Hey everyone! I've received one or two requests for the DragonPants 2 source code, and at first I had some concerns. I spent a lot of time working on DragonPants 2, and although I like sharing and want to help out people with an honest desire to learn how to code by looking at source, I know that there are a lot of hucksters and lamers on the internet who just want to hack something and stick their name on it and post it on their website.
Flash is easy enough to decompile anyway, though, and the code for DP2 is pretty terrible - since it was a side project that I challenged myself to do just to see if I could, I rushed it and didn't do my usual pre-design frameworking. I just opened up Flash and started coding, and although everything worked fine, right towards the end I started getting some problems. I got it to a level I'll call "finished," but if I were to ever work on it again I'd have to gut a lot of bad code. So it's not like this is super-precious stuff or anything.
So, I've decided to post the code for people to look at. The compromise I've reached is that all the code is freely available to view and download from this website. The .fla will remain unrealeased. This way I think I can satisfy those with an honest academic desire to understand how to do things by looking at a finished example without spoon-feeding them everything and encouraging them to do a little thinking on their own (the code by itself is almost 95% of the work, so I've left very little out of the process). Flash is a little different than other coding environments, and there are some interactions that require a visual interface and so on - like how the movieclips and functions interact.
So here is the source code for DragonPants 2! This is released under a Creative Commons license, which means some rights are reserved. You can click here to see the specific terms. Basically, I still retain the copyright, but I'm letting you use this code for noncommercial purposes, and letting you modify it so long as you share whatever you make with it as well. If I'm going to share it with you, you need to return the favor and share it with everyone else who wants it :). The graphics I'm also going to leave unreleased, and only the source code is creative common'd. So, download, learn, and enjoy!
Disclaimer: You're getting this for free, so I'm not responsible for anything it does or doesn't do to your computer, life, soul, love life, or cat. It's also released without any sort of tech support or anything fancy like that. I'm not saying I won't answer your questions if you email me, but if I get a lot of emails saying, "th1s 15 L4m3, j00 suXX0rZ it no work" I'm going to start actively ignoring you. Also, part of the challenge is figuring it out yourself! I've given you a huge piece of the puzzle here, see if you can learn on your own! There's plenty of great resources out there, so explore! I'll still be here if you're stumped. Also, this is for Flash MX (not MX 2004), so it uses the old Actionscript 1.0, and isn't anything like real object oriented programming, though AS 2.0 is a lot more like real OOP. Also, don't waste your time sending me emails telling me that Flash isn't a "real" programming language, either. I'm already aware of its limitations and everything it can and can't do. That's all! :)
Larsington
Name:
Lars A. Doucet
Location:
Living in College Station, Texas, at Texas A&M University
Age:
21
Flash experience:
Been working with Flash since version 4 my sophomore
year of high school. Now I'm a Junior in college. I just picked up MX 2004