arrays - java all values int[] 0 -
for minigame written in java, have main level , background level. player able walk in mail level, , background level solely decoration. ive written method checks visible background tiles, , puts coordinates of these tiles in int[][][]. array threedimensional, because background threedimensional. because background not visible, thought save quite processing time first checking whether single background tile visible. in other words, checking whether array containing visible background tiles, has value written in slot. when tile visible, coordinate in array becomes 1, , otherwise, remains @ default value (0 thought). guys know way check whether array contains value, program doesn't have browse through every single slot, 60 times second?
if don't want go through whole array every time, keep flag or similar tells whether there visible.
even though should have plenty of computing power go through array 60 times per second :)
Comments
Post a Comment