271
GLBasic - en / BoxColl problem
« on: 2011-Nov-04 »
Hi,
I have a screen divided in to 16x16 sections
Using for loops that are stepped by 16 from 1 to 800 and 1 to 512 (high)
An array of an objects is placed within the confines of the grid by a measure of 16x16 squares or a multiple of the same...
But the item I move around the screen (also 16x16) is not flush with some sections of the sprite array and every second section of the grid is out or incorrectly...any ideas??
I have a screen divided in to 16x16 sections
Using for loops that are stepped by 16 from 1 to 800 and 1 to 512 (high)
An array of an objects is placed within the confines of the grid by a measure of 16x16 squares or a multiple of the same...
But the item I move around the screen (also 16x16) is not flush with some sections of the sprite array and every second section of the grid is out or incorrectly...any ideas??
Code: (glbasic) [Select]
FUNCTION hitobject: xx,yy
FOREACH w IN waters[]
IF BOXCOLL(xx,yy,16,16,w.wx,w.wy,w.width,w.height) THEN RETURN 1
NEXT
ENDFUNCTION