Ahmet's AGS Fight Game 2009

Started by Gord10, Wed 13/04/2005 20:36:02

Previous topic - Next topic

Gord10

2005 version is obsolete and unavailable.
Please see my recent post for the 2009 version.

---

Hello,
I'm sorry if I'm posting this to the wrong place :(
Have you played The Great Stroke Off and seen the mini fight game, Drunken Violent Bums, in the arcade saloon?
I've released the source code of that fighting game. Because many people asked me how I could script it with AGS. I think this source code will help people for adding AI and key pressing commands.



http://www.adventuregamestudio.co.uk/games.php?action=detail&id=544

Special thanks to Barbarian for helping with some debugging. I know this game isn't perfect (especially the graphics :P), I hope someone develops the scripts more. You can ask me everything you want. ahmetkeles_16@hotmail.com or akk13us@yahoo.com

The moving scripts for the enemy AI character:
Code: ags

if ((character[EGO].x < character[ENE].x) && (IsTimerExpired(1)==1)){
  int ran=Random(3);
  if (ran==0) {
  MoveCharacterStraight(ENE,character[ENE].x-30,character[ENE].y);
  SetTimer(1,10);
  }
  if (ran==1) {
  MoveCharacterStraight(ENE,character[ENE].x-10,character[ENE].y);
  SetTimer(1,10);
  }
  if (ran==2) {
  MoveCharacterStraight(ENE,character[ENE].x+30,character[ENE].y);
  SetTimer(1,10);
  }
  if (ran==3) {
  MoveCharacterStraight(ENE,character[ENE].x-10,character[ENE].y);
  SetTimer(1,10);
  }
}
  
if (character[ENE].x>270) {
  MoveCharacterStraight(ENE,character[ENE].x-20,character[ENE].y);
    }
if (character[EGO].x>290) {
  MoveCharacterStraight(EGO,character[EGO].x-20,character[ENE].y);
    }

if (character[EGO].x<30) {
  MoveCharacterStraight(EGO,character[EGO].x+20,character[ENE].y);
    } 



They are the hitting and insulting of the enemy AI.
Code: ags

if (GetGlobalInt(204)==0) {
int ran=Random(18);
//if (IsTimerExpired(2)==0) {
if ((character[EGO].x+40 >=character[ENE].x) && (character[EGO].x<character[ENE].y)) {

  if (ran==0) {
  SetGlobalInt(200,GetGlobalInt(200)-1);
  MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
  AnimateCharacter(ENE,8,10,0);
  Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
  }
  if (ran==1) {
  SetGlobalInt(200,GetGlobalInt(200)-1);
  MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
  AnimateCharacter(ENE,9,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
    if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
 }
  if (ran==2) {
  SetGlobalInt(200,GetGlobalInt(200)-1);
  MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
  AnimateCharacter(ENE,8,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
  }
  if (ran==3) {
  AnimateCharacter(ENE,8,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
}
if (ran==4) {
  AnimateCharacter(ENE,9,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
}
if (ran==5) {
  AnimateCharacter(ENE,8,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
  SetTimer(2,30);
}
if (ran==6) {
  MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
  SetTimer(2,30);
}
if (ran==7) {
  MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
  SetTimer(2,30);
}
if (ran==8) {
  MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
  SetTimer(2,30);
}
if (ran==9) {
  DisplaySpeechBackground(ENE,"Stupid!");
  MoveCharacterStraight(ENE,character[ENE].x+10,character[ENE].y);
  SetTimer(2,30);
}
if (ran==10) {
  MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
  DisplaySpeechBackground(ENE,"You will die!");
  SetTimer(2,30);
}
if (ran==12) {
    AnimateCharacter(ENE,8,10,0);
    Wait(10);
 AnimateCharacter(ENE,0,10,0);
 if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
    } 
//}
}

if((character[EGO].x>200) && (character[ENE].x>200)) {
  MoveCharacter(EGO,character[ENE].x-40,character[EGO].y);
  }

}


You can see more in the source code.
Games are art!
My horror game, Self

Ubel

Hmm... Couldn't get it work with version 2.62. Did you make this with 2.7?

Also I think it would be good idea to move this to Technical Archive. ;DÃ,  Cause I'm sure there are lots of people who would find this very interesting.

Gord10

Quote from: Pablo on Wed 13/04/2005 21:07:02
Hmm... Couldn't get it work with version 2.62. Did you make this with 2.7?
No, made with 2.62.509, November 2004. I'll check why it didn't work.

Quote
Also I think it would be good idea to move this to Technical Archive. ;D  Cause I'm sure there are lots of people who would find this very interesting.
Yeah, guess you are right.
Games are art!
My horror game, Self

Ponch

Cool! Thanks for this. I just downloaded it and will take a look at the code over the weekend. Thanks for letting everyone in on this!

- Ponch

Gord10

Thanks :)
Anyone could run the game? Otherwise I will release another version made with 2.7.
Games are art!
My horror game, Self

TerranRich

Please release a 2.7 version if you could, as many people will be upgraded to it once it's finally released. I know I will. If I use this in my upcoming game, I will definitely credit you. :) This is awesome!
Status: Trying to come up with some ideas...

Gord10

#6
OK, I will release the new version made with v2.7 as soon as possible.

Edit: Try this: http://www.2dadventure.com/ags/ahmetfightsc27.zip
I hope it works now.
Games are art!
My horror game, Self

Nine Toes

Hmm... interesting.

I could make use of this in my game.  Thanks for the inspiration, Blue. :)
Watch, I just killed this topic...

Fribbi AGDI joker

What keybuttons am I suppose to use with this game?  ???

Gord10

Arrow keys: Move
Z: Kick
X: Punch
C: Enable defence mode
V: Disable defence mode

P.S: I'm going to release a template version.
Games are art!
My horror game, Self

Gord10

Games are art!
My horror game, Self

proximity

i noticed why script didn't work.
in second script,  line 3:
//if (IsTimerExpired(2)==0) {  ----> // is deactivating this line and also in line 82:

//}  ------->  // is deactivating bracket

if you fix these lines the script will work 
Proximity Entertainment

Gord10

Games are art!
My horror game, Self

neelhound

thanks, but if i was going to make the game, and use different character views to yours, would the scripting change?

And is it possible for spells or something?

This sis awesome.

Gord10

@Neelhound:
Yes, it is possible to use your own character views, sprites etc. You just need to replace your own scripts codes inside the default Fight Game codes. For example, if View 8 is executed in the default game when the player punches, you just need to replace AnimateCharacter(ENE,8,10,0); with AnimateCharacter(ENE,yourownnumbers,yourownnumbers,0);

But I must say these codes are for experienced AGS users; you can feel hardness if you are still beginner for AGS Script.

I Hope I could be helpful. 
Games are art!
My horror game, Self

Theme

ags should have collision boxes editing and functions for sprites!
o/

Rui 'Trovatore' Pires

Suggest it in the techie forum, why don't you.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

seraphimdreamer777

Hi I made an advanced version of the fight game with better graphics and music using the template to help me get a bit more familiar with AGS and was wondering if I could have permission to put it on this web site as my first completed project to show what I can do with AGS so far of course if I can. I'll add to the title the original copyright when the original version was released and the copyright for my version to make sure the original creator gets his credit so if its O.K. let me know and I'll put it on the web site if not then it's O.K. I'll just make someting from scratch later.Oh yea I almost forgot if I can I'll need to know the date the original fight game was made so I can put it on the title screen
Victory is my destiny

Gord10

Sure, feel free to use it :)
I think the date should be 7 April 2005; when "The Great Stroke-Off!" was released.
Games are art!
My horror game, Self

seraphimdreamer777

I put this as copyright on the game in the title screen and the Seraphim Games seal of quality screen

Based on the fight game from The Great Stroke-Off (c) 2005 Barbarian
Cool Blue's Fight Game (c) 2005 CoolBlue-Gord10
Remix Version (c) 2007 Seraphim Games

Seraphim Games (c) 2007 Joseph Ray Williams Jr.

The last one appears on the seal of quality screen only

So is all the copyright text correct if so I'll add the game a few minutes after your reply
Victory is my destiny

SMF spam blocked by CleanTalk