how can i make my player shoot enemy

Game Editor comments and discussion.

how can i make my player shoot enemy

Postby Spidy » Wed Aug 15, 2007 8:50 am

i have 2 question plz

how can i make my player shoot to enemy
&
how i make a bonus
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score

Postby jimmynewguy » Thu Aug 16, 2007 1:53 pm

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? :)
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Postby Spidy » Thu Aug 16, 2007 4:16 pm

thanks man :D
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score

Re: how can i make my player shoot enemy

Postby alek » Wed Sep 12, 2007 10:05 am

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: :?:
alek
 
Posts: 2
Joined: Tue Sep 11, 2007 12:22 pm
Score: 0 Give a positive score

Re: how can i make my player shoot enemy

Postby Bee-Ant » Wed Sep 12, 2007 10:19 am

Try this :
PLAYER
KeydownEvent>(choose your key)>CreateActor>Fire

FIRE
CreateActor>MoveTo>Enemy

Huh...I don't know it'll work or not...
Sorry
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 GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron