Collision problems with masked images.
BlitzMax Forums/BlitzMax Beginners Area/Collision problems with masked images.
| ||
I'm having some trouble with collisions between masked images. With the code listed here the tank can overlap the tiles quite a bit without regestering a hit. I've tried without the rotation and still the results are bad. The only thing that seems to fix it is to load the images without masking them. Any ideas on what could be wrong? Here are the images I'm using: ![]() ![]() |
| ||
Can anyone confirm if they have the same problem when running this code? I'm still not sure what I'm doing wrong so any help would be appreciated. Thanks! |
| ||
I'm having the same problem but after my system went pear-shaped last time I haven't made the collisions changes again. |
| ||
Hi, I tried your code with win 2k and got the same problem. It is until the pointer is over the tile that the msg appears. About the solution, haven't got a clue :S |
| ||
Thanks for checking guys. Hmm... Seems to work fine when using a single image instead of an anim image for the "ground" images. Possible bug in CollideImage? |
| ||
Found it, it's a bug with masked anim frames, if you can rebuild modules the fix is line65-68 of image.bmx in brl.mod/max2d.mod:Local window:TPixmap=pixmap.Window( x,y,cell_width,cell_height ).Copy() image.frames[cell-first]=blitz2d_driver.CreateFrameFromPixmap( window,flags ) image.masks[cell-first]=window |
| ||
Good stuff Skidracer. It works fine now. Can we have this and the imagecollide 'timage' bugfix in a new official module? |
| ||
Thanks Skidracer! I'll try it out later when I get home. |