The Daily Click ::. Forums ::. Klik Coding Help ::. First Five Object Distances
 

Post Reply  Post Oekaki 
 

Posted By Message

G. Hull



Registered
  07/01/2009
Points
  125

Wii Owner
19th February, 2011 at 21:10:38 -

Okay, so I'm having trouble with something. My goal are simple. I want to pick the first five closest items to the player, and always shoot at them or whatever. I took a look at the Advanced Direction Object example. It has what I want, except it only pick the first closest enemy. I'm looking for it to pick the first five enemies. Any help?

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
19th February, 2011 at 21:27:35 -

Someone else will have to create the code as I suck at this type of stuff, but basically this:

Once you find the distance between the player and the first object - change a flag or variable of the object to "deactivate" it.

ie:

Distance finding code finds Object 1
- Set object 1 flag 0 on

Once that is done just run the event 4 more times, changing the flags/variables as you go. When you "search" for the closest object be sure to include an event that skips the object if its Flag 0(or whatever other value you choose) is on.

Given that you already have the closest object events down you may be able to adapt something out of this. If not you'll just have to wait for someone else because I'm awful (sorry.)



 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
19th February, 2011 at 22:21:40 -

No, that's actually a very good way of doing it.

Ahhh, this makes me dream of mech's targetting a whole heap of F00's, then launch missiles in sequence... Ooh! A short delay between targetting too! Yummy...

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image
   

Post Reply



 



Advertisement

Worth A Click