Most likely problem is you have multiple bullets overlapping multiple enemies.
Often times this will destroy ALL bullets while adding only 1 to the counter, or only destroy 1 bullet and add 1 to the counter while not affecting others during the loop, or depending on your phrasing, will destroy ALL bullets while only 1 overlaps an enemy.
The other problem is, code travels from top to bottom. If it detects a bullet over an enemy in the same loop as a bullet being over a background, it will destroy it without subtracting from the counter.
Try moving the first event below the second one. That will prevent the case of overlapping enemies and backdrops at the same time.
flags didnt work : ( also i have done this with other games where it worked and it cant be a problem with many bullets over many enemies because the "bullet" is a railgun in a 1vs1 game
Should work pretty well. Just don't forget to STOP loop when bullet is destroyed.
edit- @shab, shouldn't make a difference which is above/below, since theres only 1 counter...
btw, how exactly does it "Not work"? does it collide with obstactles but not enemies, or with nothing at all, or are you even sure that the bullet is moving properly? Its possible that you're using too big of an offset with the direction calculator, and the bullet is traveling like 100 pixels at a time. This would make it appear to not do anything at all, since it would just travel offscreen.
I'm using a railgun effect exactly like this in my xmas compo game, and its been working fine...
Eh I'll test that out, but in TGF it should work in or out of fastloops. It only really matters if theres another event that references the bullet, since it might define it a a different bullet. Which would bug it out.
But I'd say yeah, do shabs idea just to be safe.
Also, it would be a better idea if you simply used 1 object as the "bullet", and never created/destroyed it.
Have a bullet object, and instead of the create event, have it get set to the position where it should originate. Instead of a destroy event, stop the loop.
That should solve all your problems if you do it right.
Frankly, I think the problem is with creating/destroying the object. He should remake it as a single-object detector, where it simply is repositioned each time you fire. I'm using exactly that in my current project, and it works like a charm.