collision and selection rts question/problem thingy
ok, im makin an rts game (not dx... im not to good in it yet)
during the code all the people and stuff are Rects
then i "render" the rects that r on the coordinates of where the screen is on the map
now in theory, that would work... im just not 100% on how to do it:
since im drawing everything using transblt on a picture box.. how would i have the prog no when i selected... say a person and which person...
could i do something like (not exact code,just a ruf outline)
on pic_click..()
if mousex and mousey > pics x etc
blah blah... more if its on the coordinates of ne rect
then:
do the stuff
endif
end sub
ok u should get the point, but a few things
1. i think i would have to loop the part where it goes thru and checks if the mouse is on a rect.. cuz i would have to do like
do until i > numOfBuildings
if mousex > blah blah building(i).x then
etc etc stuff
end if
then how would i tell if its being selected.. would i have to make some sort of an index on each thing as i make em?
and i get an error .. i forgot wut it is now (ill post source n **** later) i think it was an overflow when i tried getting the left or right or nething of a rect and comparing it to the mouses... which doesnt make ne sense...
neways, ill post the basic source later
thx in advance
gl on understanding wut i wrote