The 2 images used with ImagesCollide() do have to be valid images (i.e. loaded or created in code) but don't have to actually be displayed on screen. It's more like saying "if I draw these 2 images at these positions, will they collide?".
This makes ImagesCollide() much more versatile. Imagine if you had a scrolling game and you wanted to check for collisions between sprites that are off screen!
To correct your code, I'd probably just set a flag when the player fires, and then only do the collision check between lazer and bat when that flag is set. Remember to reset the flag when the player stops firing. :)
This makes ImagesCollide() much more versatile. Imagine if you had a scrolling game and you wanted to check for collisions between sprites that are off screen!
To correct your code, I'd probably just set a flag when the player fires, and then only do the collision check between lazer and bat when that flag is set. Remember to reset the flag when the player stops firing. :)