Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / RTS Style Selection (QUESTION)

Author
Message
wickedly kick it
19
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 21st Jul 2011 05:49
Just curious on how this could be achieved.

Assume all my "Selectable" Characters will be a type called "Character" they all have an X and Y value, as well as a boolean value of "Selected" Would i simply check if each character is in the bounds of the selection rectangle by checking if x > blah and x< blah and y >blah and y<blah. Then change all the effected characters selected variable to true? OR is there a better way to do this?

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Jul 2011 06:07
Quote: " Would i simply check if each character is in the bounds of the selection rectangle "

Yes.

Is this 2d or 3d?

wickedly kick it
19
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 21st Jul 2011 06:22
would it really matter since you would only want to select in 2 dimensions? But for sake of this 2D

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Jul 2011 06:41
selecting 3D objects could appear inaccurate when close to the camera because of the screen XY coordinates. For instance, you could have a unit's head selected but it won't register because it's not the model's origin.

wickedly kick it
19
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 21st Jul 2011 15:04
True Didn't think of that!

Login to post a reply

Server time is: 2026-07-10 15:30:55
Your offset time is: 2026-07-10 15:30:55