The Daily Click ::. Forums ::. Klik Coding Help ::. Enemies All Shoot At Once
 

Post Reply  Post Oekaki 
 

Posted By Message

Ahvulon Jun



Registered
  30/09/2016 20:09:00
Points
  27
1st October, 2016 at 01/10/2016 03:05:01 -

I have the enemies in my top down shooter shoot out an invisible object, if the object hits the player and not a wall, the enemy shoots. The problem however is that if one enemy hits you with the invisible object it acts as if they can all see you and they attempt to shoot you through walls. I would like for someone to explain how to make it so when 1 enemy sees you he shoots at you and no one else does.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
1st October, 2016 at 01/10/2016 17:43:55 -

You have to somehow narrow down which enemy is selected when they shoot.

The best way is to use spread values and have an ID for both the enemy and the detector.

Then do:

If ID of detector equals ID of enemy
-Set detector position to enemy position

If detector overlaps player
And ID of enemy equals ID of detector
-Enemy shoot

 
n/a

Ahvulon Jun



Registered
  30/09/2016 20:09:00
Points
  27
1st October, 2016 at 01/10/2016 22:18:38 -

Thanks, I made the enemies have a random id that the detector shares and now it allows me to do what I wanted.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
5th October, 2016 at 05/10/2016 22:03:26 -

You don't have to use a random ID. Using spread value simply assigns values to all instances of an object from whatever number you gave it + the number of instances.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
19th October, 2016 at 19/10/2016 02:09:09 -

As long as its all in the same line you should be able to use the only one instance thing

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click