Hi,
I have a huge sun entity in my level. It is passable and it can damage the spaceships by using a vec_dist(sun.x,ship.x) command to see if the ship is too close.
I also have a scanner system on the users HUD. He can scan for enemies who are within his range. Now I have two issues:

a) If there's something in the way (between player ship and enemy), the player should not be able to "see" the enemy on his scanner, meaning he can't target him either. With asteroids, it's no problem, I send a c_trace outand if it gets blocked I disable the targeting. The problem is with the sun: since it's passable, the trace doesn't hit anything. Can anyone think of a way of checking if the c_trace passed within XY quants of the sun's origin? I know about line-point calculation, but I'd like to see if there's a simpler trick.

b) For the commands "next enemy" and "previous enemy", I currently just "scroll" through an array and return the next/previous entry. Problem here is that I don't yet know how many enemies there will be at the end, and will never know, cause players can buy more objects that are also seens as enemies. So I was thinking if anyone had a doubly-linked-listed coded? You know... re-inventing the wheel and stuff.
Or can anyone think of simpler solutions?
I want to be able to add to that list (when a new enemy joins the battlefield) or remove enemies from the list, I also need to clear it somehow at the end of a round.

Last edited by Germanunkol; 08/07/09 08:23.

~"I never let school interfere with my education"~
-Mark Twain