As I’ve developed as a Flash coder over the past month some of my earlier work is looking a little bulky. I can already see where some of my earlier code decisions are going to bite me in the ass later on down the road.
Where Flash is a viking is in its ability to quickly prototype practically anything. You can string together spaghetti code, copy & paste some snippets from random tutorials, and shoe horn logic onto the timeline. It doesn’t take a rocket scientist to build a Flash application and it certainly doesn’t take an Engineer.
To the average Flash developer, Packages, Classes and Design Patterns are just added work. Why take the time? Well, like most short-cuts, cutting corners while coding saves time in the short-term but can seriously impact your productivity in the long-term.
Dynamic Art
The first thing I want to change with my Hero class is remove all of the content from the movieclip, import the frames of animation from a tileset .png file, and dynamically generate my hitTest objects. But why? Well at some point I’ll need to hire an artist. That artist is going to create art in Photoshop. I need to be conscious of the “Art Workflow” and develop my engine in a way that improves that. By allowing my Hero to be built from an external .png, I save about an hour of work every time the art changes. I can also send the artist a .swf file that they can use to test the art as they develop it. Plus the code I develop here should be easily reusable for any sprite I want, be it the Hero, an NPC or Enemy. In the end, a few hours of work setting this up will saves me dozens of hours on this project and many more down the road.
The principles here were much like what I did with the tile engine. I load the external .png file to a Bitmap. I then copy pixels from the source data to a small activeFrame bitmap. This allows me very fine control over which frame of animation is displayed. This also allows me to make my Hero class a Sprite instead of a MovieClip. Because everything is now handled programmaticly, I no longer need timeline information to store animations.
This is part of a series of articles that go over the steps I’m taking to learn Flash CS3. The project’s goal is to develop an RPG similar to those published by Square in the mid/late 1990’s. (Secret of Mana, Final Fantasy VI, etc..)







{ 4 comments… read them below or add one }
LOL, this is how I feel about my code every time I write something. My new game that’s about to launch “very soon” I hope (finalizing it with my primary sponsor) has 94 classes. And while I don’t have a problem with a bunch of classes, I never planned on it to be that many so I did little to organize them. But at least I have a naming convention I went by.
And at the same time, the first game I wrote and released has imports in it that I know are not used anywhere in the game.
That’s part of learning though I guess.
And excellent points on using a PNG for your animations. I can’t wait to see this game finished, I got really high hopes for it.
BTW, At some point I wouldn’t mind highlighting some of your posts on AS Gamer or letting you write a Guest Article if you would like. You’re a much better writer than I am.
LOL, catchy title btw too. “A hero with more class”… genius.
Wow, its pretty coincidental, I’ve been researching tutorials to work on a similar project. I too work at EA, and started my time as a QA guy. Small world!
Anyway, this log of the development cycle and skill growth is pretty amazing, and immensely helpful!
Keep on keeping on…
Hi there, just read about your blog and it’s cool. Really like FFIV and dying to know how it was created
We are a group of individuals that are currently developing simple RPG using AS3.o. We have completed the tile-engine and scrolling. Our next thing will be developing the Quest engine for the RPG. Can you share some of your idea and concept in developing the Quest engine. It would be really helpful if there is some tutorials related to it.
Cheers
Hi! Great blog! Im happy to see there are also others who are trying to create a flash rpg game with a professional attitude. Im trying to make one myself too. My approach is some what different from the “classic” tile engine. I will make the game are “freeform” so movement is not bound to tiles. Its a fun challenge. I have pathfinding pretty much figured out so far. Oh, coding is so much fun! (when there are no bosses or deadlines…)
Please keep posting!