Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » why is only one option animating even though they both have code
- yayapoppity
-
Scratcher
1000+ posts
why is only one option animating even though they both have code
https://scratch.mit.edu/projects/1396361301/
so in my game, when you hover over an option after clicking the feed button it changes to a different screen thing i dont know what to call it
however only the forage option(and the storage option i guess) animates when you hover over it even though they both received the broadcast.
i know they dont have minigames yet, thats not what im trying to fix, im just asking for the hunt button to actually animate
i dont know if animate is the right word for this
so in my game, when you hover over an option after clicking the feed button it changes to a different screen thing i dont know what to call it
however only the forage option(and the storage option i guess) animates when you hover over it even though they both received the broadcast.
i know they dont have minigames yet, thats not what im trying to fix, im just asking for the hunt button to actually animate
i dont know if animate is the right word for this
- Obscurallax
-
Scratcher
3 posts
why is only one option animating even though they both have code
The problem lies in that the broadcast is receiving that your mouse is still down when you clicked the arrow.
Whenever you click the arrow, it summons the hunt button, but your mouse is still down when the button is summoned, so it thinks you clicked the button.
The fix is quite simple.
Original:
I hope this helps!
Whenever you click the arrow, it summons the hunt button, but your mouse is still down when the button is summoned, so it thinks you clicked the button.
The fix is quite simple.
Original:
when I receive [foodoptionsshow v]Fixed:
show
repeat until <<touching [mouse-pointer v] ?> and <mouse down?>>
if <touching [mouse-pointer v] ?> then
switch costume to [costume2 v]
else
switch costume to [costume1 v]
end
end
when I receive [foodoptionsshow v]This makes the program wait until the click has finished, therefore not registering it as you clicked the button until it has already summoned.
show
wait until <not <mouse down?>>
repeat until <<touching [mouse-pointer v] ?> and <mouse down?>>
if <touching [mouse-pointer v] ?> then
switch costume to [costume2 v]
else
switch costume to [costume1 v]
end
end
I hope this helps!
- yayapoppity
-
Scratcher
1000+ posts
why is only one option animating even though they both have code
This makes the program wait until the click has finished, therefore not registering it as you clicked the button until it has already summoned.ok thanks!
I hope this helps!
closing topic because answered
Last edited by yayapoppity (Yesterday 17:41:32)
- Discussion Forums
- » Help with Scripts
-
» why is only one option animating even though they both have code