Discuss Scratch

LTD_1108
New to Scratch
2 posts

How do I make a sprite only disappear when it's Y value is higher than its other clones?

I am making a rhythm game input, and I need it to where when the arrow is cloned, it only disappears when it's Y value is higher than its other clones. If you need me to be more specific about the code I'm using, I can do so .
bcs320jn
Scratcher
100+ posts

How do I make a sprite only disappear when it's Y value is higher than its other clones?

Make each clone input their Y value into a list, and then ask if the the clone's Y positions is greater that the others.

Dankiel_
Scratcher
100+ posts

How do I make a sprite only disappear when it's Y value is higher than its other clones?



when I start as a clone
add (y position) to [clone y pos v]
forever
show
set [above clones? v] to [10]
set [i v] to [1]
repeat (length of [clone y pos v] :: list)
if <(item (i) of [clone y pos v] :: list) > (y position)> then
set [above clones?] to [0]
end
change [i v] by (1)
end
if <[above clones?] = [10]> then
hide
end
end



Last edited by Dankiel_ (Jan. 25, 2022 01:01:26)


Making pokemon :O (not done yet)
https://scratch.mit.edu/projects/646516982/
LTD_1108
New to Scratch
2 posts

How do I make a sprite only disappear when it's Y value is higher than its other clones?

Thank you bcs320jn and Dankiel_!

Powered by DjangoBB