Discuss Scratch

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
Obscurallax
Scratcher
2 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:
when I receive [foodoptionsshow v]
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
Fixed:
when I receive [foodoptionsshow v]
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
This makes the program wait until the click has finished, therefore not registering it as you clicked the button until it has already summoned.
I hope this helps!
yayapoppity
Scratcher
1000+ posts

why is only one option animating even though they both have code

Obscurallax wrote:

This makes the program wait until the click has finished, therefore not registering it as you clicked the button until it has already summoned.
I hope this helps!
ok thanks!

closing topic because answered

Last edited by yayapoppity (Yesterday 17:41:32)

Powered by DjangoBB