Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » An inexplbale bug.
- Darrman
- Scratcher
100+ posts
An inexplbale bug.
I was working on a project, Pow-Up!, where you click on a question block to make an item appear. I set the variable so at 0 it would be behind the block, and it would pop out at 1. I also set it to go down to 0 when greater than 1. The thing is, they don't appear when I click on them, and the variable keeps going up! I can't see the coding bug. Could anyone help? I did this on 1.4, if that's anything.
- P110
- Scratcher
1000+ posts
An inexplbale bug.
Pow-Up!, where you click on a question block to make an item appear. I set the variable so at 0 it would be behind the block, and it would pop out at 1. I also set it to go down to 0 when greater than 1. The thing is, they don't appear when I click on them, and the variable keeps going up! I can't see the coding bug. Could anyone help? I did this on 1.4, if that's anything.Hey Darraman, I was working on a project,
I'll take a quick look now!
- P110
- Scratcher
1000+ posts
An inexplbale bug.
Aha! Found the bug. I remixed the project with box 3 fixed just to show you but, here is what was wrong:
This is what you origionally had
This is what I now have, I wrapped it in a forever loop to make it keep checking and then added a stop script block to make it stop repeating itself
This is what you origionally had
when gf clicked
set [blk3 v] to [0]
go to x:(180) y:(0)
if <(blk3) = [1]>
glide (1) secs to x:(180) y:(90)
end
if <(blk3) = [1]>
go to x:(180) y:(0)
end
This is what I now have, I wrapped it in a forever loop to make it keep checking and then added a stop script block to make it stop repeating itself
when gf clicked
set [blk3 v] to [0]
go to x:(180) y:(0)
forever
if <(blk3) = [1]>
glide (1) secs to x:(180) y:(90)
stop [this script v]
end
if <(blk3) = [1]>
go to x:(180) y:(0)
stop [this script v]
end
end
- Discussion Forums
- » Help with Scripts
- » An inexplbale bug.