Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MrPlow

Pages: 1 ... 17 18 [19]
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??

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



272
GLBasic - en / Collisions
« on: 2011-Nov-03 »
Hi,

I have a problem with my collision detections...

I have code (not at hand right now...) written that looks for box collision item against an array of items ... by iterating through screen section in blocks of 16 pxls

When it finds the item the collision should revert back to pre position and then validate that the 32 pixels of either side of the 32 px box is collision free before continuing....

Hope i made myself clear...

I expect that using array objects is the only collision method and that useasbmp and current pixel colouring cannot be checked to provide an alternative?

Checking the colour of pixels as test would be a nice way based on the useasbmp so that 100s of arrays do not need to be examined...

G.

Pages: 1 ... 17 18 [19]