Lets say, oh, I wanted to make a fighting game (as an example). How would I make a a character select system, where there are 8 playable characters that I can chose from, to play as?
AGES ago, when I first got TGF, I tried having seperate frames for each character combination possible, IE: Char1 vs Char2, then anotehr frame for Char1 vs Char3, etc. That method really sucked.
When I got better and better at TGF, I found an open source game, that used global values to set the character value. On each stage, all the characters were placed, and at the start of the frame, all the characters were eliminated, except for the character whose value matched the global value that was set at the char select screen. that method only works with simple games, and would never work in a fighting game, where each character is unique, and has many moves.
So does anyone know how I can tackle this problem?
-coming soon-
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
28th March, 2005 at 07:07:43 -
Make groups for all characters in the play frame and deactivate them all. Also make a group called 'at start' which isn't deactivated.
Now go to the selector frame. Then make a global value change from 1 to 8, depending on which character you choose.
Now at the start of every level the game should check (in the start group) which value the Global value is and activate the right group(s).
I didn't test it, but I'm pretty sure it will work.
The second method would work Giga-Guy. You just have to code all the moves and such for each and every character. You could make each character a group, and only have the group activate if the character is present. Then inside the group you would have all the combos and moves and such.
Although, if you wanted two player, you would have to make every single character twice. Once for each player.
Hope this helps.
"Computers in the future may perhaps only weigh 1.5 tons."
-Popular Mechanics, forecasting the development of computer technology, 1949
I guess so. I never actually thought about having groups that are activated and deactivated. I guess that would work then. But isnt there an easier way?
Have only two fighters in a frame. Whichever character is selected determines which animations are displayed, as well as variables determining things like reach, speed and power. Plus of course special moves that can only be performed by certain characters.
Radix's way is easy for the beginning, but will get too complicated later on. I'd go with DaVince's method. If you have MMF, you might also want to use behaviours, because they organize the code.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
there is no easy way to make a good game!
Hard work, sweat, blood and tears is the key!
i still can't see the problem.
if you're too lazy to use any of those tecniques, you're too lazy to make a game at all! Just hard work, hard work...
Make all the characters for player one, and set their group to player one group. Now do the same for player two (possibly by cloning them and setting them to player twos movement). Now set all their animations so each character has the same ones. Ex. Kick,Punch,High Kick,High Punch, Special One. Now make it so that at the start of frame it eliminates all the characters not selected using global values. Then when a button is pressed, have "player one group" animation set to kick or something like that. For damage when character 1 is colliding with group player 2 or whatever you do for your attacks collisions, subtract damage from player 2 health bar. Hope this helps, and this seems the easiest way i would do it.
"Actually sir, we found a tiny unicorn in your exhaust. It was jumping around poking holes in your gas tank." "Oh thank you I did not know that. A tiny unicorn? Wow."
"there is no easy way to make a good game!
Hard work, sweat, blood and tears is the key!
i still can't see the problem.
if you're too lazy to use any of those tecniques, you're too lazy to make a game at all! Just hard work, hard work..."
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.