Aug 31, 2012

Radar and Spawn

I have improve the targeting system with the following updates:

1. 3D Radar

 I have spent a short time to built a simple 3D pointing system 2-3 weeks back and now I have merged it under my targeting system. When the selected target is in view, the 2D lock system will work; if it is not in view, then the 3D pointing system will kick in to show the player where the target is. Standard stuff in jet combat game, there is nothing much to it.

I am thinking of using this system to warn player about incoming missiles or item/location of interest, but that is for another day in the coming future.
Target Selected

The radar will point to the target when it is not in view


2. Dynamic Target Addition and Marking

I am now able to add new target in run-time dynamically.

In AddTarget(), new target (which currently are of type Transform, this be will change soon) is added to the list in the targeting system; then a new marker is instantiated and attached to the target.


3. Spawn

To test the dynamic target addition and marking mentioned above, I have write a simple spawning script to spawn gameObject in the scene, the spawning mechanism then call AddTarget() using the new gameObject as parameter. As a result, the targeting system will recognize the spawned object as a active target and a new marker will be attached to it.

This spawning mechanism is so simple and effective, I think I will be using it in spawning enemies.
There are no active targets in scene.
Spawned targets are all marked properly.

No comments:

Post a Comment