Post

 Resources 

Console


Re: But what if... Jack Hoxley (0 replies, 0 views) (2001-Jan-2)
-
Although I've never made a game where the user can click on an object (as in C&C style select?)... but if I did I'd just cycle through all the objects on the screen and decide which one was on the square - assuming only one could be on a square at once.... you could use inequalities to cut out a lot of processing as well... ScreenLeft <= X <= (ScreenLeft + ScreenWidth) ScreenTop <= Y <= (ScreenTop + ScreenHeight) rules out anything not on screen; you could do more to narrow it down to only a half/quarter of the screen... but dont do too many - it'll end up slower! Jack;


-
Up One Level | Back to Forum


Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 90 visitors within the last 20 minutes
RSS News Feed