direct access to vector elements similar to arrays

Posted by mixm on Stack Overflow See other posts from Stack Overflow or by mixm
Published on 2010-05-23T15:20:30Z Indexed on 2010/05/23 16:11 UTC
Read the original article Hit count: 244

hi. im currently creating a tile based game, where elements of the games are placed in four different vectors (since there are multiple game objects with different properties, hence stored in different vectors). these game elements themselves contain x and y coordinates similar to how they are stored in a two dimensional array. i was wondering if there was a way to access these vector elements similar to two dimensional array access (currently i am implementing an for loop to cycle the elements while comparing its coordinates). this kinda sucks when i need to refresh my display at every game cycle (since the large number of comparisons and loops).

im implementing this in java btw.

© Stack Overflow or respective owner

Related posts about java

Related posts about vector