Client-side radar
by Brendan Dillon · in Torque Game Engine · 08/09/2005 (4:04 pm) · 2 replies
Hi
I've added this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2270
to my game and I works great, now i'm trying to expand on it so that aswell as showing bots the radar will also display keys that the player must select in my game, I don't want any other items such as health packs to appear on the radar.
If anyone had used this code in the past or has any pointers on the best way to expand on it I would be very greatfull for your help
regards
Brendan
I've added this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2270
to my game and I works great, now i'm trying to expand on it so that aswell as showing bots the radar will also display keys that the player must select in my game, I don't want any other items such as health packs to appear on the radar.
If anyone had used this code in the past or has any pointers on the best way to expand on it I would be very greatfull for your help
regards
Brendan
About the author
Torque Owner Gary Preston
Then you just need a check inside the loop and to change the colour accordingly. There are a number of ways you could test whether a given object is a key or not. For example if all your keys use the same datablock called "KeyObject" you could edit the render loop to be
if ( (shape->getType() & StaticShapeObjectType) && (!dStricmp(shape->getDataBlock()->getName(), "KeyObject")) ) { glColor4f(1.0,1.0,0.0,1.0); // Yellow dots for keys glVertex2f(newCoord.x,newCoord.y); } else{ // check for other shape types and colour accordingly }...