Either check the total distance between the two objects( and then run the shooting-events if it is less than 200, duh ), or use a big-ass detector object to check if it overlaps with the baddies/player.
The Advanced Direction calculator can help with distances between two objects.
I use a big invisible active object square that always follows the player at a certain point at the top-left, so that it looks like the player's in the center of a big gray square. When the enemy overlaps this invisible square, it shoots at the player. It acts like a line of sight. Really simple and it works great.
So, I second the big-ass detector object mentioned above.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
I don't want to have to use the detector only becasue it will have to be huge in some levels and I don't want the game running any slower.
I'm still having troubles with the distance between the two and don't exactly know how to tell the events what I'm trying to do.
I want the 'Baddie Man' to shoot every half second at the 'Sprite' when 200 pixels close in a circle radius, but how do I do this event? I can get the seconds part but not the first part.
Thanks for that Ben, your equation was almost perfect. I just had to say <= 200.
My second question is, and I don't know if it's possible. But for the Baddie to shoot the Player only when there is nothing between them such as a wall or a box.
Create a detector bullet that shoots constantly (only 1 at a time), when the player is in range, and if it reaches the player, start following/shooting at him.