Discuss Scratch

ExpertNoob1019
Scratcher
32 posts

Clone bullets don't work

So I'm making a tower defense game, PvZ style with the multiple lanes and stuff. And of course it has some shooting characters. The regular shooters are fine from what I can tell, but when I place down about 10 DOUBLE shooters (shoot two bullets), then some of them don't fire. But only a few, which is strange. When I have two columns of Double shooters next to eachother, on some lanes, I only see two bullets appearing, or in some cases, even just one! Because it's clones firing the bullets, I made variables called “BulletX” and “BulletY” so the bullets would know what coordinates to go to when they are created. And I think the problem is that some of them are firing on the same frame, messing up the variables. So I tried to fix it with a custom block with “Run without screen refresh” on and the problem persists, but a tiny bit less. Any ideas?
bombardingppl
Scratcher
500+ posts

Clone bullets don't work

could you share us the link?
BigNate469
Scratcher
1000+ posts

Clone bullets don't work

BulletX and BulletY should both be set to “this sprite only” (I assume you're using clones), so that a copy is made for each clone.

It's possible that each bullet is individually spawning more of itself, and you're running into the 300 clone limit as well.

Even if it's not done, can you share the project with us so that we can see exactly what's going on?
ExpertNoob1019
Scratcher
32 posts

Clone bullets don't work

Yea, but the game isn't finished yet. Also, the sprite is making clones of ANOTHER sprite, so making it “for this sprite only” wouldn't work. Also both the shooter sprites are making clones of the same bullet sprite. And I can't change it to be clones of themselves, because the shooters are clones too.
Alt-141421356_
New Scratcher
3 posts

Clone bullets don't work

ExpertNoob1019 wrote:

Yea, but the game isn't finished yet. Also, the sprite is making clones of ANOTHER sprite, so making it “for this sprite only” wouldn't work. Also both the shooter sprites are making clones of the same bullet sprite. And I can't change it to be clones of themselves, because the shooters are clones too.
I think the solution might be changing “bullet x” and “bullet y” to lists. This way, even if shooters are firing at the same frame, the lists will recieve both data. Also, when the coordinates from the lists are recieved, you should remove this data, so it won't take space in the lists.

Powered by DjangoBB