PDA

View Full Version : Nietzsche: My first AS2 game


SHDR
07-07-2007, 09:17 PM
Being a game design student, my second semester project was to build a single-screen arcade game from scratch in Flash. I'd never written a line of AS before, barely touched upon Java and had very little to do with Flash except occasional swearing at the hideous GUI. That was about to change.

The game is pretty simple. Your avatar is constrained to the central area of the screen, you change colors by clicking the left mouse button, and try to catch bullets of your color to fire back at the enemies, who circle you in a set path. Your goal is to create relative equilibrium between the two enemy types, a task made more difficult by the fact that they not only fire at you, they also fire at each other. So the game is pretty much about attempting to control chaos.

There are some nuances as well. You can charge enemies by shooting them with bullets of their corresponding color. That way, you can either protect them from switching colors when hit by a bullet of the opposite color, or you can hit them three times to change the entire group the enemy is part of. This enables you to even the odds pretty quickly, but it's risky since the balance tends to shift pretty massively when you switch an entire group.

There's a lot of issues with the game, of course, since it is my first one. There's a very bad lack of ceremony in the game. Your win condition is either to survive with relative equilibrium until the time runs out, or to keep absolute equilibrium for ten seconds. Those are some pretty vague goals, and makes the game seem unfocused even though the mechanics themselves are relatively decent. Since I had so little experience with AS2 at the time, the game over and victory ceremonies are pretty bad, and they more or less just *happen* out of thin air, with little anticipation, making both victory and loss a bit of an anti-climax. There's also very limited graphics, both because of my inexperience with scripting animation and because the structure of my program is pretty bad. I hadn't read a single article on design processes when I started writing the code, which meant I would have had to restructure and reprogram the entire project over again to get proper animation in there. Since I was approaching deadline and had already rewritten the code three times, I decided to polish the turd rather than start over again and risk not being able to hand in a finished project.

Either way, I'm sharing it for educational purposes. Someone might find it useful, others might want to take a look at my 2000-line monstrosity to find out what you shouldn't do when coding a game in AS2. Feel free to pilfer, plunder and sack the game for any code you might find useful. Use the graphics too, if you like. I've attached the main Flash file containing graphics and the full code as well as two sample levels. My server is, unfortunately, broken down, so I don't have anywhere else to put it. Maybe later. It might be for the best anyway, since there's no preloader (it wasn't intended to be a web app, and I don't think it runs particularly well in any browser). Use the Flash stand-alone player for best performance. Either way, the hideous coding and the massive overuse of non-cached vectors (n00b, n00b, n00b) makes it a serious resource hog. I had trouble running it on anything below a P4 3GHz on medium quality.

What else ... I failed to embed my font, so it will probably use a default font, and make most of my text look really wonky. That's life, though. There's a couple of weird bugs in there that I've never been able to figure out, and while there's not supposed to be anything game breaking in there, expect the unexpected. If you want to use any of the code, and have any questions, feel free to post them here and I'll try to explain what I've done as best as I can. Enjoy!

(Oh, and the title, Nietzsche, is a joke. I was inspired by Japanese shmups making this, and they usually name their games hilariously obscure things like Psyvariar, Espgaluda, Einhänder and so on. They often riff on German philosophy as well, and I figured I'd call this Nietzsche as a homage. You don't take any side in the presented conflict, you just try to make the sides equal. Ergo: Beyond Good and Evil.)

thh022
07-16-2007, 08:31 AM
it would be interesting to see your game. can you upload it on an server so we can play it in a browser?

a lot of people, including me, won't download zip-files, because of the danger of viruses.

fauzira
07-16-2007, 09:13 AM
Nice game, but wow.. your code is bit.. :D
I like the ideas, better if you add more effect and more colorfull. I've got new ideas from your games.
Thanks!