I am a newbie at Flash/Flex and Actionscript 3.
I would like to know how can I create a dress up game in Flash/Actionscript where users can click on (not drag and drop) the available accessories/clothing and the avatar will display with the new selection immediately, and I can save the settings and take snapshot of the avatar in the new cloth开发者_如何学运维ing selection. It will be good if there is references/tutorials that I can follow.
And secondly, may I know how do I save the selection, is it via xml or json or database? It will be good to store the clothes/accessories dynamically.
Thank you very much.
If you're a newbie, you may want to have a look at some basic Flash programming tutorials, I think Colin Moock does a pretty good job of introducing Actionscript 3 in his "Lost Actionscript Week End" video series, which you should find on Adobe TV.
After this, you could have a look at Object Oriented Programming and Design Patterns, the Decorator pattern may be of particular interest for your game.
When you'll understand more about OOP, I don't think that saving a selection shouldn't be a problem, but you may have to look into a server side language like PHP...
You'll need to familiarize yourself with the basics first as PatrickS mentionned.
Once you're ready to dive in the development of this, you'll have to consider a few options in the way you store the avatar's appearance to a remote file / database.
A few options are: - Dynamically take a snapshot of your avatar (with a BitmapData.draw( ... ) call), and pass the byteArray of your snapshot to a URL where your server will expect and save your avatar to a file / database entry. - Dynamically take just the bare information needed (avatar skin color, clothing, accessories, positions maybe too), and pass this as a formatted string (can be XML, JSON, URL-Encoded even, whatever you're comfortable with) to a URL where your server will expect and save your avatar data to a file / database entry. To call this back though, you will need to develop also a writing mechanism for your Flash avatar to take this information back from the server and re-apply it.
The 1st method is the simplest way. On your server, you can use PHP's GD library to do the image manipulation if you need to crop or resize too.
And yes... I've done this before, too many times lol.
If you're at the beginning of your journey, it will be pretty hard to start your engines but from my own experience I must admit that learning by example if one of the best methods to do something. So I suggest you to find and analyze a source code of an already made game and try to reskin it for the beginning. Then you can add your own contribution to the structure of the game, modify the code adding new features and so on... If you still need help in creating dress-up game, I invite you to download the zip file of my version of a dress-up game I created for letsplaygirls website.
Dress-Up Game Source Code - Flash .fla
精彩评论