Discuss Scratch

tame_doggo
Scratcher
10 posts

floor 2 in mining game spawns 7x as much ores as it should

I am making a mining game and when you go to a new floor, it should spawn a few ores around the level. However, floor 2 does not. It spawns 42 ores instead of 6, and i have tried about everything but i cannot seem to fix it. I don't think i will be able to update unless it gets fixed. Could someone look into its code and see if i missed something? Thanks.


PS- i tested and the player doesn't seem to be making the “start new area” command broadcast 7 times.
Catscratcher07
Scratcher
1000+ posts

floor 2 in mining game spawns 7x as much ores as it should

you need to add something to stop clones from receiving the start new area broadcast
medians
Scratcher
1000+ posts

floor 2 in mining game spawns 7x as much ores as it should

Catscratcher07 wrote:

you need to add something to stop clones from receiving the start new area broadcast
Yeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
1.

Create a variable to check if it is a clone. Make sure for this sprite only is on.
2.
Add this script:

Clones will have 1 set to that variable, while the sprite itself will have 0 now.
ded_PC
Scratcher
100+ posts

floor 2 in mining game spawns 7x as much ores as it should

medians wrote:

Catscratcher07 wrote:

you need to add something to stop clones from receiving the start new area broadcast
Yeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
1.

Create a variable to check if it is a clone. Make sure for this sprite only is on.
2.
Add this script:

Clones will have 1 set to that variable, while the sprite itself will have 0 now.
But, change the ‘1’ to ((Clone) + (1))
medians
Scratcher
1000+ posts

floor 2 in mining game spawns 7x as much ores as it should

ded_PC wrote:

medians wrote:

Catscratcher07 wrote:

you need to add something to stop clones from receiving the start new area broadcast
Yeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
But, change the ‘1’ to ((Clone) + (1))
Well, if you wanted to distinguish clones then maybe.
ded_PC
Scratcher
100+ posts

floor 2 in mining game spawns 7x as much ores as it should

medians wrote:

ded_PC wrote:

medians wrote:

Catscratcher07 wrote:

you need to add something to stop clones from receiving the start new area broadcast
Yeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
But, change the ‘1’ to ((Clone) + (1))
Well, if you wanted to distinguish clones then maybe.
The problem with your code is that every time it would just set it to ‘1’ when there are ‘6’
Clones
medians
Scratcher
1000+ posts

floor 2 in mining game spawns 7x as much ores as it should

ded_PC wrote:

medians wrote:

ded_PC wrote:

medians wrote:

Catscratcher07 wrote:

you need to add something to stop clones from receiving the start new area broadcast
Yeah, it should be made more clear that clones can receive broadcasts. There is a way to detect clones though:
But, change the ‘1’ to ((Clone) + (1))
Well, if you wanted to distinguish clones then maybe.
The problem with your code is that every time it would just set it to ‘1’ when there are ‘6’
Clones
Though, they said the issue was that every clone to not receive the broadcast, when none of them were supposed to.
ded_PC
Scratcher
100+ posts

floor 2 in mining game spawns 7x as much ores as it should

Then make a floor variable too and use a costume number for it
medians
Scratcher
1000+ posts

floor 2 in mining game spawns 7x as much ores as it should

ded_PC wrote:

Then make a floor variable too and use a costume number for it
..just use this.
when I receive [broadcast v]
if <(clone?) = [0]> then
...
end
ded_PC
Scratcher
100+ posts

floor 2 in mining game spawns 7x as much ores as it should

medians wrote:

ded_PC wrote:

Then make a floor variable too and use a costume number for it
..just use this.
when I receive [broadcast v]
if <(clone?) = [0]> then
...
end
Oh, that makes sense, I'm an IDIOT
tame_doggo
Scratcher
10 posts

floor 2 in mining game spawns 7x as much ores as it should

Thanks for the help everyone! I fixed it and now it only spawns 6 ores!

Powered by DjangoBB