Page 1 of 1

[Method][Demo] Target Nearest Enemy

PostPosted: Wed Apr 02, 2014 12:32 pm
by Bee-Ant
Actually feral already made this kind of demo here:
viewtopic.php?f=4&t=5995
But the problem is, he uses Bubble Sort which may be better suited for advanced coder. But then, what about for newbie who's still very new to coding and stuff?
Here, I made this demo specially for you guys. Also, as complement to feral's demo.

Explanation
===========
Basically, the method goes this way:
- Player keep producing scanner toward the group of enemies
- Enemy who touches the scanner first will set the target coordinates
- When the Player shoots, bullet will be directed to the target coordinates

As simple as that.
For the detailed code, please take a look at the demo attached bellow.

Re: [Method][Demo] Target Nearest Enemy

PostPosted: Wed Apr 02, 2014 2:50 pm
by jonathang
Wow, you're back and I also just got what I was looking for (this awesome demo! :D)! This is the best gE day ever! Thanks!!! Definitely going to credit you for this Bee-Ant! :D +1

Re: [Method][Demo] Target Nearest Enemy

PostPosted: Wed Apr 02, 2014 3:35 pm
by Bee-Ant
You're welcome.
Glad to see what I made is usefull for others :D

Re: [Method][Demo] Target Nearest Enemy

PostPosted: Wed Apr 02, 2014 5:08 pm
by NightOfHorror
See you are still useful, so come and keep making games/demos/happy people. :D