I have re-written my test program to use CollideImage instead of ImageCollide but it seems to run at the same speed. I am only using one collision layer.
Could someone run my program (using an arbitrary background of the same size (1024x768)) and see what the maximum number of collisions they can do per frame (set ncol to different numbers), before you stop dropping frames. My monitor refreshes at 60Hz, but if yours is different it will at least give me some idea.
On my computer it runs smoothly with ncol=20, but then starts to drop frames around ncol=26.
Use the 'Z','X',';',.' keys to move the white cube around the screen. It is easy to see the difference in the smoothness of the cube's movements if the program is straining.
------------------------------------
Could someone run my program (using an arbitrary background of the same size (1024x768)) and see what the maximum number of collisions they can do per frame (set ncol to different numbers), before you stop dropping frames. My monitor refreshes at 60Hz, but if yours is different it will at least give me some idea.
On my computer it runs smoothly with ncol=20, but then starts to drop frames around ncol=26.
Use the 'Z','X',';',.' keys to move the white cube around the screen. It is easy to see the difference in the smoothness of the cube's movements if the program is straining.
------------------------------------
'TEST PROGRAM Graphics 1024,768,16 DrawRect 0,0,32,32 image:TImage=CreateImage(32,32) image2:TImage=CreateImage(32,32) GrabImage(image,0,0,0) GrabImage(image2,0,0,0) back:TImage=LoadImage("RMedia\backdropB.png") SetBlend SOLIDBLEND Cls ResetCollisions(0) x=0;y=200 ncol=30 'ncol is the number of collisions checked for between 'the image and the background each loop ResetCollisions(1) CollideImage(back,0,0,0,0,1) Repeat xv=0;yv=0 lk=KeyDown(KEY_Z);rk=KeyDown(KEY_X) jk=KeyDown(KEY_COMMA) uk=KeyDown(KEY_SEMICOLON);dk=KeyDown(KEY_PERIOD) If lk Then xv=-1 If rk Then xv=1 If dk Then yv=1 If uk Then yv=-1 x=x+xv;y=y+yv DrawImage back,0,0 DrawText " test "+test,0,0 test=0 ' below loop performs a number of collision checks ' between image and the background For t=1 To ncol If CollideImage(image,x,y,0,1,0) Then test=1 Next DrawImage image,x,y,0 Flip 1 Until KeyDown(KEY_ESCAPE)