Enemy Control

Game Editor comments and discussion.

Enemy Control

Postby Azou » Fri Oct 12, 2007 8:32 pm

Hello! I don't have lot of time it's why my current game is stopped. But i have a question:how to make an actor walk,punch,jump...without any key....like a CPU? And how to make him not very...stupid? :D :D
Attachments
what.gif
Sangoku with his new pose...but i think that he's a boxer!!
User avatar
Azou
 
Posts: 514
Joined: Thu Sep 13, 2007 1:12 pm
Score: 35 Give a positive score

Re: Enemy Control

Postby Azou » Wed Oct 24, 2007 4:10 pm

So ihave seen the Mortal kombat topic,i tried butt nothing is good. We always show me a error message.How ca n i fix the problem? :D :P
User avatar
Azou
 
Posts: 514
Joined: Thu Sep 13, 2007 1:12 pm
Score: 35 Give a positive score

Re: Enemy Control

Postby Bee-Ant » Thu Oct 25, 2007 12:29 pm

maybe you could do this : (you have to create "right" , "canjump" and "EnemyAttack" Actor variables first)

Enemy>CreateActor>ScriptEditor>
1. make a random timer (1000 to 5000 ms) called "EnPunch"
2. make a random timer (1000 to 5000 ms) called "EnKick"
3. make a random timer (1000 to 5000 ms) called "EnJump"
4. make a random timer (1000 to 5000 ms) called "EnRight"
5. make a random timer (1000 to 5000 ms) called "EnLeft"

Enemy>Timer>EnPunch>ScriptEditor>
Code: Select all
if(EnemyAttack==0)
{
    if(right==1)
    {
         ChangeAnimation("EventActor", "EnemyPunchRight", FORWARD);
    }
    else
    {
          ChangeAnimation("EventActor", "EnemyPunchLeft", FORWARD);
    }
    EnemyAttack=1;
}

Enemy>Timer>EnKick>ScriptEditor>
Code: Select all
if(EnemyAttack==0)
{
    if(right==1)
    {
         ChangeAnimation("EventActor", "EnemyKickRight", FORWARD);
    }
    else
    {
          ChangeAnimation("EventActor", "EnemyKickLeft", FORWARD);
    }
    EnemyAttack=1;
}

Enemy>Timer>EnJump>ScriptEditor>
Code: Select all
if(canjump==1)
{
    yvelocity-=10;
    canjump=0;
}

Enemy>Timer>EnRight>ScriptEditor>
Code: Select all
right=1;
ChangeAnimation("EventActor", "EnemyWalkRight", FORWARD);

Enemy>TImer>EnLeft>ScriptEditor>
Code: Select all
right=0;
ChangeAnimation("EventActor", "EnemyWalkLeft", FORWARD);

Enemy>AnimationFinish>EnemyPunchRight>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor", "EnemyStandRight", FORWARD);

Enemy>AnimationFinish>EnemyPunchLeft>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor", "EnemyStandLeft", FORWARD);

Enemy>AnimationFinish>EnemyKickRight>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor", "EnemyStandRight", FORWARD);

Enemy>AnimationFinish>EnemyKickLeft>ScriptEditor>
Code: Select all
ChangeAnimation("EventActor", "EnemyStandLeft", FORWARD);

Enemy>AnimationFinish>AllAnimation>ScriptEditor>
Code: Select all
EnemyAttack=0;

Enemy>DrawActor>ScriptEditor>
Code: Select all
if(right==1)
{
    if(EnemyAttack==0)
    {
        x+=3;
    }
}
else
{
    if(EnemyAttack==0)
    {
        x-=3;
    }
}


Fiuh...too long. If you still confused or this code can't works fine, I'll make a demo... :roll:
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

Re: Enemy Control

Postby Azou » Thu Oct 25, 2007 7:46 pm

you help me very very much!!! thanks loy!!!!!!
User avatar
Azou
 
Posts: 514
Joined: Thu Sep 13, 2007 1:12 pm
Score: 35 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron