The Daily Click ::. Forums ::. Klik Coding Help ::. Detectors / shooting / Spreading a Value to ID baddie problem
 

Post Reply  Post Oekaki 
 

Posted By Message

badoona



Registered
  27/03/2006
Points
  209
13th July, 2007 at 01:42:01 -

Some of the bad guys in my new game Get Flocked use detectors to decide to attack you or not. Workings are something like this.

If good guy is in range of bad guy = bad guy shoots small left or right detector (will be made invisable in game)

If detector hits, they bad guy shoots bullet (or whatever it is) in the direction of the dector that hits.

This works very well and it very solid.

However if I have two of the same bad guy in the same area then they BOTH fire, This causes some of the bullets to go off in stupid directions (why?).

I have programmed it so if the detectors hit, the bad guy has to be in range of the good guy to fire. This helps if the bad guys are either side of the good guy (only the rioght one shoots) but if two are near to each other, on the same side of the good guy, then both fire whenever one of the detectors hit and the second one's bullets go off in strange directions.

I need to solve two problems here.

1) The only bad guy to fire when there detector hits is that single bad guy!! Not his mate standing next to him that might be looking the other way or who is not meant to be ready to fire again yet!

I've looked up spreading a value but am not sure it's what will work in this case as it looks to me like you'd have to then assign numbers to the dectors and bullets too - is this the way (and how best to do it)...

2) When two bullets are in the air and more are fired, directions must not mess up!

Any advice on this new problem would be most apreicated.
I could just avoid putting more than one of the same mid range baddie next to each other but I don't want to limit myself in that way.



 
n/a
   

Post Reply



 



Advertisement

Worth A Click