Discuss Scratch

Periodic_Videos
Scratcher
56 posts

Fixing bugs

I'm working on this project (https://turbowarp.org/672676293/editor) and it has quite a lot of bugs. I'm annoyed with these bugs for a long time already. Or I've just code something wrong…
Bug 1: You can fish by pressing enter key without touching the lake. I want it to start fishing only when touching the lake.
Bug 2: When you've unlocked lake 2 and 3, you can fish multiple sprites at a time. For example, you're touching lake 2, but you tend to also fish in lake 1 and you got more money than expected.
Bug 3: The “Times fishing” variable doesn't change value at all.
I hope this could be easy to fix. Thanks a lot if you could help me!
KaaBEL_sk
Scratcher
100+ posts

Fixing bugs

1. You have:
repeat until <key [enter v] pressed?>
if <touching [player v] ?> then
broadcast [Fish here v]
end
if <(Times fishing) > (1)> then
broadcast [Fish here v]
end
end
and then Fish here loops forever → always when enter pressed it fishes:
when I receive [Fish here v]
go to [front v] layer :: looks
forever
...
end
2. Asking for the time at the start is very uncertain. First time I answered 5 i worked, but later tried 300, 8, and didn't work. (Im gonna add example)
3. Use lists or other way instead of tons of broadcasts and then if blocks.
Periodic_Videos
Scratcher
56 posts

Fixing bugs

KaaBEL_sk wrote:

1. You have:
repeat until <key [enter v] pressed?>
if <touching [player v] ?> then
broadcast [Fish here v]
end
if <(Times fishing) > (1)> then
broadcast [Fish here v]
end
end
and then Fish here loops forever → always when enter pressed it fishes:
when I receive [Fish here v]
go to [front v] layer :: looks
forever
...
end
2. Asking for the time at the start is very uncertain. First time I answered 5 i worked, but later tried 300, 8, and didn't work. (Im gonna add example)
3. Use lists or other way instead of tons of broadcasts and then if blocks.
Helpful! Thanks!
KaaBEL_sk
Scratcher
100+ posts

Fixing bugs

set [Timer v] to (0)
repeat until <(Timer :: variables) > (0)>
if <<not <((answer) + (1)) = (1)>> or <(answer) = (0)>> then // my way to detect number
set [Timer v] to ((answer) * (60))
else
ask [Write number only! How long do you want to play?] and wait
end
end
But I think you want it to be that player choose from one of the game time and he tries than to earn as much as possible (speedrun competiting) then I would suggest using button options.
Edit! : timer in repeat until was ment to be variable Timer

Last edited by KaaBEL_sk (April 9, 2022 10:23:00)

Periodic_Videos
Scratcher
56 posts

Fixing bugs

KaaBEL_sk wrote:

set [timer v] to (0)
repeat until <(timer) > (0)>
if <<not <((answer) + (1)) = (1)>> or <(answer) = (0)>> then // my way to detect number
set [timer v] to ((answer) * (60))
else
ask [Write number only! How long do you want to play?] and wait
end
end
But I think you want it to be that player choose from one of the game time and he tries than to earn as much as possible (speedrun competiting) then I would suggest using button options.
Oh OK thanks I gonna see if it works
GingerTheCat8658
Scratcher
6 posts

Fixing bugs

Bug: Lakes dont appear.
Periodic_Videos
Scratcher
56 posts

Fixing bugs

GingerTheCat8658 wrote:

Bug: Lakes dont appear.
:O
Juliur
Scratcher
9 posts

Fixing bugs





if <<touching color > and <not <touching color >
>
Fish

<touching [ v] ?>end

Last edited by Juliur (April 10, 2022 07:58:33)

Juliur
Scratcher
9 posts

Fixing bugs

when green flag clicked
forever
if <<touching color [#105723] ?> and <<not ><touching color [#105723] ?>> then
Fish
end
end

Last edited by Juliur (April 10, 2022 08:03:27)

Periodic_Videos
Scratcher
56 posts

Fixing bugs

Juliur wrote:

when green flag clicked
forever
if <<touching color [#105723] ?> and <<not ><touching color [#105723] ?>> then
Fish
end
end
Hmmm… I'm also thinking of that. Thanks for the help!
Juliur
Scratcher
9 posts

Fixing bugs

when green flag clicked
forever
if <<touching color [blue] ?>and<not<touching color [green]>>> then
Fish
end


I think it work so!
nintendo3dsx
Scratcher
1 post

Fixing bugs

Hhheeellllppp
Periodic_Videos
Scratcher
56 posts

Fixing bugs

nintendo3dsx wrote:

Hhheeellllppp
Please don't necropost (reviving dead forums)
also help? on what?

Powered by DjangoBB