Advertisement

Fighting Games and the coding of them

Started by August 24, 2000 04:09 AM
3 comments, last by Ziphren 24 years, 4 months ago
Hello, y''all! The game I''m attempting to make is a weed smokin'' game, where you start out as a neonate in the stoner subculture. You run around town trying to out-smoke people to gain their respect. The format is a one-on-one style Smoke Out where you can bust out special moves (Street Fighter) and combos (Tony Hawk). Well anyway, this is my first project, and I''m having some developing problems... I really have no idea where to begin in the coding of the special moves. I don''t know whether to use a bunch of timers, or counting variables, or classes, or what... Ooooh the stress... So if anyone has ideas, /experience/source code to help me out, I will greatly appreciate it! Thanks, all you peeps!
later,Ziphrenhttp://ziphren.iuma.comhttp://www.newscientist.com/news/
well... you could have keys / combos or a menu for the special moves or whatever... and just have a switch statement checking if those key(s) are down..
Advertisement
Use a key buffer.
simply store the keys that are typed in an ordered buffer, and you just look at the content, seeing if there isn''t a combo that is being done.
Or you could use a special button to indicate that you want to do a special move : if the Ctrl key is pressed, then record the keys that are pressed as long as the Ctrl button is down. Then when it''s up again, look at the keys that have been typed, and execute whatever move that is, or none if it''s a mistake ...

hope it helps ?

youpla :-P
-----------------------------Sancte Isidore ora pro nobis !
Sounds easy enough in English...
Now let''s just see if my newbie-wannabe C++ skillz can do it!

Laterz()
{
FellOverDead = true;
}
later,Ziphrenhttp://ziphren.iuma.comhttp://www.newscientist.com/news/
Well, I was thinking about it again, and basically, the idea is that (in most games) they store the movement keys that you have pressed lately.
And when you press an attack key, they look in the movement key buffer, and execute the attack depending on what they find.

If you pressed, say, Right, Punch , then it''s just a punch...
If you pressed, Top, Left, Down, Right, Punch, woohoo ! it''s a Fireball (or whatever )

Also, you could put a time signature when you store a key in the buffer. This is so that you would ignore the keys if they are to far apart in time (you have to do the special moves quickly).
You could have also a separate buffer that stores the actual attacks that you have done lately so that you can identify Combos (if you have done a Low Kick followed by a High Kick, then execute the Dragon Tail Kick ?)

I don''t think you should worry too much, it''s not as difficult as it sounds

All you need is to understand how to get keys in a nice manner, and how to use buffers.
IF I can suggest something. Be real crystal clear from the beginning as to HOW you identify attacks.

There is a difference between pressing an attack key while pressing move keys, then release which trigger the attack (personnaly I like this method), and the more classical approach of pressing move keys, THEN attack key... sometimes you have to press the attack key AND the last move key, sometimes not...
so when you do your first prototype, decide early what you want, do it, then test it. Then don''t be afraid to find a new and original way to do it...

hope it helps

youpla :-P
-----------------------------Sancte Isidore ora pro nobis !

This topic is closed to new replies.

Advertisement