Discuss Scratch

SuperXavierLandYT
Scratcher
10 posts

Sprite follow sound

i'm making a detection test where the code goes like this

If player goes near sprite, then start sound. if sound is heard by sprite 2. follow the sound until reaching player

Sprite 2 follows the sound to players location.

Any ideas on how to make that happen?
Tyh99
Scratcher
18 posts

Sprite follow sound

when green flag clicked
forever
if <touching [ v] ?> then
play sound [ v]
end
end

and make an invisibe hitbox inside the sprtie
medians
Scratcher
1000+ posts

Sprite follow sound

I don't know if people remember about this block..
SuperXavierLandYT
Scratcher
10 posts

Sprite follow sound

Uh what about the sprite following that sound?
PurpleSuit
Scratcher
500+ posts

Sprite follow sound

(sorry it is messy i hope you understand)

for enemy
when green flag clicked
forever
if (<[distance to [player] = < [number]>) then
repeat until <touching player>
follow player script
end
end
end
for player
when green flag clicked
forever
if ([distance to = then
play sound [sound] until done
end
end
this will give the illusion that when it hears you, it will chase you, set both numbers to the same value

Last edited by PurpleSuit (Jan. 23, 2023 14:53:46)

Powered by DjangoBB