Checking for enemies in BGT

Hi,
I'm working on implementing a few very simple killable objects in my BGT test files that I will call, for the sake of simplicity and portability, enemies. I have functions that can determine distances between two points and whatnot, but I don't know how to tell the game what enemy is closest. For example, if I want to shoot at something off to my right, I will rotate in that direction to face it and shoot at it. A distance formula will run to see how far I was from the object and act accordingly. Simple enough. What I don't know how to implement is helping the game aim and kill the right object. I will have my enemies in a 2D Array, unless there's a better way. I don't want to constantly search through the array to find the closest enemy to my position as a method of finding what I'm shooting at, because that'll take too much CPU time. Is there another way to do this? If I have multiple enemies on the map, I need the game to know what enemy I'm aiming at. So thanks for any assistance.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector

Reply via email to