Discuss Scratch

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.

RIP Scratch Smash Team! Thread here.

I made a thread about adding an Enter command in the “When whatever pressed.”
Thread is here.



I like Fire Emblem. Hail Zigludo!
P110
Scratcher
1000+ posts

An inexplbale bug.

Darrman wrote:

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.
Hey Darraman,
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
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
Darrman
Scratcher
100+ posts

An inexplbale bug.

Thank you! Will fix it with the other two boxes now.

RIP Scratch Smash Team! Thread here.

I made a thread about adding an Enter command in the “When whatever pressed.”
Thread is here.



I like Fire Emblem. Hail Zigludo!
Darrman
Scratcher
100+ posts

An inexplbale bug.

Done!

RIP Scratch Smash Team! Thread here.

I made a thread about adding an Enter command in the “When whatever pressed.”
Thread is here.



I like Fire Emblem. Hail Zigludo!
P110
Scratcher
1000+ posts

An inexplbale bug.

Darrman wrote:

Done!
awesome!

Powered by DjangoBB