Discuss Scratch

jimbog
Scratcher
6 posts

Can't find the bugs in this one...

Hi,

Really hope someone can help…

This game seems to work fine up until you get a few wrong (been doing it to test it out) and then the lady repeats earlier times on different backdrops and the man tells you an answer is wrong when it is right. It seems to do it anywhere from about the third backdrop.

I have checked all the code is linked to the correct place, but I think it doesn't seem to stop certain scripts when it moves on.

I don't expect anyone to make it perfect but have tried everything I can think of, but to no avail. Please let it be something simple.

I'll love you forever if you fix it and donate £5 to the charity of your choice if you can help me!!!

Thanks

AonymousGuy
Scratcher
1000+ posts

Can't find the bugs in this one...

Which project is it?

Also I don't need any donations.

Last edited by AonymousGuy (Dec. 17, 2013 23:07:45)

drmcw
Scratcher
1000+ posts

Can't find the bugs in this one...

It has to be a problem with the pointer sprite. It contains many when blocks followed by forever loops, which means they will never end. So you're going to have quite a few scripts that will be running on different backdrops and so your broadcasts will go out of sync because the scripts that should be running on other backdrops will still be running. You need to add something to get the forever loops to stop, you have a stop this script on some of them but not all. (“stop other scripts in sprite” perhaps?)
Word of advice for the next time is to choose a sprite or more usually the stage as the “master controller” and have that contain a script which coordinates everything else using broadcasts it then avoids script spaghetti which is incredibly difficult to debug.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
scubajerry
Scratcher
1000+ posts

Can't find the bugs in this one...

I have a remix that fixes it. I just can't share projects right now (Scratch is having a problem). I will try again in a bit.
jimbog
Scratcher
6 posts

Can't find the bugs in this one...

AonymousGuy wrote:

Which project is it?

Also I don't need any donations.

Yes, that would help! Its http://scratch.mit.edu/projects/15312230/

Thanks. Any input would be amazing
jimbog
Scratcher
6 posts

Can't find the bugs in this one...

drmcw wrote:

It has to be a problem with the pointer sprite. It contains many when blocks followed by forever loops, which means they will never end. So you're going to have quite a few scripts that will be running on different backdrops and so your broadcasts will go out of sync because the scripts that should be running on other backdrops will still be running. You need to add something to get the forever loops to stop, you have a stop this script on some of them but not all. (“stop other scripts in sprite” perhaps?)
Word of advice for the next time is to choose a sprite or more usually the stage as the “master controller” and have that contain a script which coordinates everything else using broadcasts it then avoids script spaghetti which is incredibly difficult to debug.

OK, thank you. I will try and stop those forever loops. If that doesn't work then are you suggesting a different (green arrow) sprite for each stage? I had thought I might need to have new sprites for each one but was trying to avoid that amount of extra work!
jimbog
Scratcher
6 posts

Can't find the bugs in this one...

Wow, thank you DRMCW and scubajerry.

I see what you have done in the remix Scubajerry and that does make a lot of sense.

I also followed drmcw's advice and added an extra pointer for each backdrop to try and minimise any ‘crossed wires’ and this seems to have done the trick. Just need to try and neaten the animation on speaking now!

This is a project I have been working on for university and it has taken three days so far (!) and to come up with this bug which I have been unable to resolve has been a real pain.

As promised, I would like to thank you both and genuinely, let me know what charities you support and I will donate to the two of them. I'm in the UK so if you are not then I will go for one that is most similar if thats ok?

Thanks again!
scubajerry
Scratcher
1000+ posts

Can't find the bugs in this one...

jimbog wrote:

Wow, thank you DRMCW and scubajerry.

I see what you have done in the remix Scubajerry and that does make a lot of sense.

I also followed drmcw's advice and added an extra pointer for each backdrop to try and minimise any ‘crossed wires’ and this seems to have done the trick. Just need to try and neaten the animation on speaking now!

This is a project I have been working on for university and it has taken three days so far (!) and to come up with this bug which I have been unable to resolve has been a real pain.

As promised, I would like to thank you both and genuinely, let me know what charities you support and I will donate to the two of them. I'm in the UK so if you are not then I will go for one that is most similar if thats ok?

Thanks again!
Glad it helped. No donation required.
scubajerry
Scratcher
1000+ posts

Can't find the bugs in this one...

jimbog wrote:

Wow, thank you DRMCW and scubajerry.

I see what you have done in the remix Scubajerry and that does make a lot of sense.

I also followed drmcw's advice and added an extra pointer for each backdrop to try and minimise any ‘crossed wires’ and this seems to have done the trick. Just need to try and neaten the animation on speaking now!

This is a project I have been working on for university and it has taken three days so far (!) and to come up with this bug which I have been unable to resolve has been a real pain.

As promised, I would like to thank you both and genuinely, let me know what charities you support and I will donate to the two of them. I'm in the UK so if you are not then I will go for one that is most similar if thats ok?

Thanks again!
Maybe what you did uis what DRMCW had in mind, but I kind of doubt it. I think you will still run into trouble with your implementation. I will leave my remix up for a couple of days. Good luck.
drmcw
Scratcher
1000+ posts

Can't find the bugs in this one...

No donation required. Glad it's working.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
jimbog
Scratcher
6 posts

Can't find the bugs in this one...

Thanks again peeps!

Powered by DjangoBB

Standard | Mobile