View Full Version : how to put the chosen charactor onto the Stage in a fighting game?
06-13-2003, 01:51 PM
i hav a question in making fighting game, that is, before the
fight starts we ususally choose the fighter(and sometimes
arena), and it'd always be some MCs, so how can i relevantly
attach that choosen MC(fighter) to the "fight" Stage (or scene).
06-13-2003, 05:05 PM
It is abit vague to answer your question, so I'll be speaking generally...
Character Selection Screen
Have a variable like selectedChar, and assign a number to it when the character is selected like selectedChar = 2; and once everything is selected/prepared to the actual fighting, use gotoAndPlay("StartFight");
Fight Start Screen
Set the frame label to "StartFight" right here...
Ideally you will have multiple characters in a movieclip with its linkage identifier set to 'char1', 'char2', and so on...
Do the attachMovie() function with selected character...
this.attachMovie("char" + selectedChar, "player", ... );
And then you get to go to the actual fighting scene with the timer counting down to zero and such...
Good luck... :)
06-13-2003, 06:39 PM
I can understand Cyan's response but did things slightly different with my own created fighting game and thought I could share my different approach.
I created a Character object and used a global variable to reference two characters, currentCharacter and currentOpponent. Once the user decided which character they wanted all subsequent screens would be determined by the global variable 'currentCharacter'. Also, once the user selected the opponent they wanted to fight the subsequent screens would also reflect the 'currentOpponent'.
That has a couple benefits worth mentioning:
1. You can easily keep score and stats for 'currentCharacter' throughout the game play process.
2. You can store the object on the users computer as a shared object. This is a lot of fun so that if you want to shut down your browser and return the progress will be maintained.
You can take a look at my game (not very good with animation):
Hope our thoughts will help you!
06-13-2003, 06:53 PM
Nice... Not easy game to win though... :)
Yup... padnpen's plan is more structured, and good... A bit hard thing to do since you are actually dealing with the objects...
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.