✅ Could anyone explain to me why, on the second time, the code is skipping the thread "animation"?
So i'm making a small turtle race for a college assignment, and while testing I discovered that after running the code for the first time, it jumpss from tt5.register into the winner's VictoryScreen and skiping the code that would represent the race.
Could anyone explain what I did wrong to make that happened?
7 Replies
Here is the code:
https://paste.mod.gg/gghfoisbxulm/0
BlazeBin - gghfoisbxulm
A tool for sharing your source code with the world!
what is inside Reset?
are you ever stopping the threads?
in a new run the old threads still run
Oh, no
How do I stop the thread?
currently to finish the thread that turtle has to win..
so after any turtle won you would have to break out of the loop
thats just guessing but i think what happens is
one turtle win you get into vicotryscreen
then until you start the second run one of the other turles wins
and therefore you go right to the next victory screens
in reset you would need another flag whch you set and then check inside your while loop wo stop the loop from continuing
or alternatively hava variable outside of turtle that manages if a race is currently running
Okay, thanks for the help