Fighting Game Enemy

You must understand the Game Editor concepts, before post here.

Fighting Game Enemy

Postby GuybrushThreepwood » Sun May 03, 2009 7:25 pm

I'm making a two person fighting game. Two people fight at the same time, and I want to know how to make the computer try to attack the player
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Fighting Game Enemy

Postby skydereign » Sun May 03, 2009 7:47 pm

Personally, I would create functions for each attack you want the enemy to do. That way, upon the time of attack, a controlled random event, it will make the enemy attack, and it can't do anything else. When the attack ends, it may continue about its AI life. The function would set the enemy's animation, set a variable to signify attack, and other. This really depends on how you are doing damage, general attacking, and more. I could help you out, but can you post a demo of your game? Or perhaps you could just explain it. But here is a sample of what I am talking about.
Code: Select all
void
AI_Sword(void)
{
     //The change animation code here
     Enemy_Attack=1;  // this would be an int, if it equals one, it can't do anything
     //Other code depending on what system you are using
|

If you don't like this method, I can show you several more.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Fighting Game Enemy

Postby GuybrushThreepwood » Mon May 04, 2009 12:37 am

it's not that kind of fighting game, its like mortal combat type style. :mrgreen:
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Fighting Game Enemy

Postby jimmynewguy » Mon May 04, 2009 1:39 am

Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Fighting Game Enemy

Postby GuybrushThreepwood » Mon May 04, 2009 6:29 am

well these are good, but in my game there are combo attacks. how would i do that?
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Fighting Game Enemy

Postby skydereign » Mon May 04, 2009 6:39 am

I vaguely remember helping you with the combos. I would really do these by function calls, that way the actual code would be less convoluted. But if you don't want to set that up, then what you would need to do is add an animation finish event. If you want it to always combo, then upon the animation finish, you trigger the next attack, if not, then you would set a rand in, and if it is the right number, continue the combo.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Fighting Game Enemy

Postby Bee-Ant » Mon May 25, 2009 3:15 pm

GuybrushThreepwood wrote:well these are good, but in my game there are combo attacks. how would i do that?

Use Keydown->Press the keys->and change the "at least one key pressed" to "..."
Keys as order or something
Sorry I forget :oops:
Just see it yourself
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest