ImagesCollide Problem

Blitz3D Forums/Blitz3D Programming/ImagesCollide Problem

Oiduts Studios(Posted 2009) [#1]
Ok, i have a problem i have loaded two of the same graphic twice under different names, when i call these commands through a function only the first one works, as in if i put one on top of the other the top one only works, i have never ran into a problem like this, can someone please help me, i will be out for a while so i will post back later. thank you for helping! There are no errors in running the program either, everything is global.

If ImagesCollide(mouse,MouseX(),MouseY(),0,barlicon2,80,10,0) And MouseHit(1) Then PlaceBarrel(playerx,playery,playerz+5)

If ImagesCollide(mouse,MouseX(),MouseY(),0,barlicon,10,10,0) And MouseHit(1) Then PlaceBarrel(playerx,playery,playerz+5)



Warner(Posted 2009) [#2]
I think the problem is caused by the usage of MouseHit. You can basically use it best once every loop:
mh = MouseHit(1)
If ImagesCollide(mouse,MouseX(),MouseY(),0,barlicon2,80,10,0) And mh Then PlaceBarrel(playerx,playery,playerz+5)

If ImagesCollide(mouse,MouseX(),MouseY(),0,barlicon,10,10,0) And mh Then PlaceBarrel(playerx,playery,playerz+5)



Oiduts Studios(Posted 2009) [#3]
Thank you so much i have done everything to get it working, but it works now, thank you.