Posted By: alex5801
problem - 10/31/06 20:09
Code:
this code is use to swap character to use in the game and how player can command the computer player
anyone know what is the problem with the coding in green color? i keep getting problem when i include it to run the level
ACTION player_action
{
my.gravity = 3;
my.z_offset = 6;
player = my;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);
ent_create("player2.mdl", you.x, computer_player);
ent_create("player.mdl", my.x);
if(key_q==1)
{
if(player1.state_skill==1 && Player2.state_skill== 0)
{
ent_remove (my);
me = ent_add ("player2.mdl", my.x);
ent_remove(you);
you = ent_add ("player1.mdl",you.x);
}
else{
if(player1.state_skill==0 && Player2.state_skill== 1)
{
ent_remove (my);
me = ent_add ("player1.mdl", my.x);
ent_remove(you);
you = ent_add ("player2.mdl",you.x);
}
}
}
action computer_player{
computer = me;
while (computer !=NULL)
{
me.vec[0] = you.vec[0]-60;
me.vec[1] = you.vec[0]-60;
if(key_g ==1)
{
me.vec[0] = you.vec[0]+60;
me.vec[1] = you.vec[0]+60;
}
if(key_b==1)
{
me.vec[0] = you.vec[0]-60;
me.vec[1] = you.vec[0]-60;
}
}
}
this code is use to swap character to use in the game and how player can command the computer player
anyone know what is the problem with the coding in green color? i keep getting problem when i include it to run the level