Page 1 of 1

how can i make my player shoot enemy

PostPosted: Wed Aug 15, 2007 8:50 am
by Spidy
i have 2 question plz

how can i make my player shoot to enemy
&
how i make a bonus

PostPosted: Thu Aug 16, 2007 1:53 pm
by jimmynewguy
for ur first question just do this on a keydown event of the actor u want to shoot :D
Code: Select all
if (ammo.textNumber >= 1) //to only shoot when u have ammo//

if (animindex == getAnimIndex("guy walk r") ||
    animindex == getAnimIndex("guy stop r"))
{
  CreateActor("bullet", "BULLET", "(none)", "bullet r", 55, 0, false);
  ammo.textNumber -= 1;
}

else if (animindex == getAnimIndex("guy walk l") ||
    animindex == getAnimIndex("guy stop l"))
{
    CreateActor("bullet", "BULLET", "(none)", "bullet l", 30, 0, false);
    ammox.textNumber -= 1;
}
//to create the bullet on either side//

and have an ammo actor thats a text number, and 2 paths for ur bullet,bullet l, and bullet r. I know im kinda confusing but i hope that answers ur first question. :wink:

as for ur second question u should be more specific, what kind of bonus? :)

PostPosted: Thu Aug 16, 2007 4:16 pm
by Spidy
thanks man :D

Re: how can i make my player shoot enemy

PostPosted: Wed Sep 12, 2007 10:05 am
by alek
Pleace, Help Me!
I have got here accidently, but I have the same first question.
At the beginning I rejoiced at the news.
But when I read the answer, I made :roll: :?:

Re: how can i make my player shoot enemy

PostPosted: Wed Sep 12, 2007 10:19 am
by Bee-Ant
Try this :
PLAYER
KeydownEvent>(choose your key)>CreateActor>Fire

FIRE
CreateActor>MoveTo>Enemy

Huh...I don't know it'll work or not...
Sorry