Game Development Community

2D fighter

by Oscar Lantigua · in Torque X 2D · 09/16/2007 (7:04 pm) · 1 replies

Hi everyone, I'm new to torque X and want to know if its possible to make a 2d fighter game like Street Fighter 2. I've check the forums and garage games demos multiple times trying to see if someone has built one or is in the process of building a 2d fighter. Is it even possible? I think a game like street fighter requires a sprite to have multiple collision boxes and probably each frame needs its own collision boxes. Looking at TXB i see that it only supports one collision box per sprite. check out the image included to see what i mean:



i238.photobucket.com/albums/ff249/nacv2000/multicollisionbox.gif
Please someone help and answer my questions if you can

About the author

Recent Threads


#1
09/28/2007 (8:07 am)
There are other ways to do the same thing without having a seperate collision box for each frame of the animation. You could have 1 collision box per fighter on the screen (regardless of animation) and have a state machine to keep track of what "state" each fighter is in every frame (kicking, punching, moving, crouching, etc...). Keep track of and change if necessary each fighters "state" each frame, and then when an action occurs (button press) then detect if a collision occurs and do some calculations to determine based on the states what the result is.

For example....

If Fighter 1 is "Kicking" and a collision occurs with Fighter 2 (ie, that means they are close enough that the kick can land) then do some calculation to determine if the kick from Fighter 1 is successful (or blocked) and then show the relevant animations, damage meter adjustments, etc...

So in short, use the collision boxes on each fighter just as a range monitor, to determine if the fighters are close enough to hit one another, and then use calculations based on their "state" at the time one of them initiates an offensive action to determine what happens and what animations to show, etc....