DemoProductions / shmup

3 stars 2 forks source link

Tracking issue and Tag or Flag Class #59

Closed flip40 closed 8 years ago

flip40 commented 8 years ago

Just thoughts... Part of what I currently have Team working for is to determine trackable objects. This makes it convenient for some things to specifically not have a Team. The downside though, is that some things either need to be on a team, or participate in team shenanigans (for example, "bullets" that need to determine who to damage). This becomes inconvenient in its current state because we don't know if an object needs to have a "team" variable set. This is much easier if we just check for a Team component. This is good, until missiles track everything with a Team component (other missiles included now).

This is just a flawed implementation of using Team as what determines trackable objects. My reason for doing so, however, was to avoid having a "Trackable" script that just sets isTrackable = true/false, because that seems like a waste of a script.

The idea might be workable though if we find use a generic "Tag" or "Flag" class that could be used for other tags in the future, starting with a tag (variable) for "isTrackable", and simply attach this to gameObjects that need the tags.

What do you think of this? Do you think there would be use cases for such variables outside of my tracking issue? Or a better solution to the tracking issue?