Posted By
|
Message
|
W3R3W00F Drum and Bass Fueled Psycho
Registered 08/11/2008
Points 370
|
10th December, 2009 at 03:05:41 -
I've decided to pick up a game again (For who knows how long) and recently added a little notifier in the HUD that alerts the player of the distance between him and the enemy. It works more or less like it should, but still, there is a problem.
Objects: 1.) A counter that is set to the distance between the player and the enemy using the Advanced Direction Object. 2.) The notifier, which has 4 different animations: pale green (safe), yellow (caution), red (very close), and dark red (in view).
Current coding method: The notifier turns green if the counter is <= or >= to 1500, yellow if the counter is <= or >= to 1000, red if the counter is <= or >= to 300, and dark red if the counter is <= or >= to 100. It works, but not as intended.
Desired Result: The goal is to get the colors to change, not when the counter hits 100, 300, 1000, and 1500 exactly, but as well as anywhere between those numbers (Pale green: 1500-1001 | Yellow: 1000-301 | Red: 300-101 | Dark Red: 100-0) Through several minutes or speculation, nothing came to mind.
Any help is appreciated!
EDIT: Clarified a few segments that may have been confusing and unnecessary capitalization.
Edited by W3R3W00F
n/a
|
OMC What a goofball
Registered 21/05/2007
Points 3516
|
10th December, 2009 at 03:22:21 -
Your <= or >= system is confusing me. Perhaps I misunderstood, but it seems as simple as Counter is <= 1500 + >= 1000, change color to green, etc? I don't get the problem if that's not what you're looking for.
|
W3R3W00F Drum and Bass Fueled Psycho
Registered 08/11/2008
Points 370
|
10th December, 2009 at 04:09:57 -
Coolio, that did it! Man, I should've known that already.
Thank ye a bunch, OMC!
n/a
|
OMC What a goofball
Registered 21/05/2007
Points 3516
|
10th December, 2009 at 13:21:59 -
No problem dude.
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1970
|
10th December, 2009 at 14:23:53 -
..or you could have a continuous range of colors: http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Colors.mfa
n/a
|
|
|