LoginLogin

RTS selection help

Root / Programming Questions / [.]

therx1Created:
I've been trying to make a RTS selection box that can actually detect sprites and return a value. When I use sphitrc it doesn't return anything because getting the witdh and height of a RTS selection box is hard when the arguments doesnt like zeroes. I'm wondering if anyone can help me find the width and height of a selection box (what I mean by a selection box is the type you use on your desktop to move application, in MOBAS to move your here's or in RTS games to move units). An alternative method on doing this is also welcomed ^-^.

You should keep track of your units with an array instead of trying to detect them with a collision hack.

can you explain pls? how would i know if it hits my selection box if my units are in an array? also what would i even put in the array?

You know if it contains them because your array would contain the locations of your units and you know the location/dimensions of your selection region. It seems I missed your real initial problem, "find the width and height of a selection box," because it wasn't clear. What are you doing to create this region? How does the user create it?

The first point (the top left corner) is started when you are touching the screen and x is pressed, and the 2nd point just follows the where the touch screen is tapped.

bumping so more people see

bumping so more people see
Yeah, please don't spam. Do you know TOUCH, and all its components?

yes, thats what i am using.

And how are you using SPHITRC?
When I use sphitrc it doesn't return anything
It always returns something. Which of the 4 'forms' of SPHITRC are you using (see built-in help for the 4 forms)? What values?