Discuss Scratch

AmgenS
Scratcher
8 posts

Same Code on Different Sprite not working

I'm creating a platformer and i put the same code on a different enemy sprite (when you attack it and it's health goes down.) I put the same code on a flying enemy but instead it doesn't work.
The_Imaginarium
Scratcher
1000+ posts

Same Code on Different Sprite not working

You need to share the link to the project.
TheAnomalousPseudo
Scratcher
1000+ posts

Same Code on Different Sprite not working

Sharing the project would definitely help. Off the top of my head, though, when you move code between sprites/projects the local and cloud variables break and you have to replace them all (usually).


We ought to be careful with that octopus that takes over the servers. He's well armed.
AmgenS
Scratcher
8 posts

Same Code on Different Sprite not working

mstone326
Scratcher
1000+ posts

Same Code on Different Sprite not working

Using the glide block, nothing can check until the glide block completes. Here is an example showing. https://scratch.mit.edu/projects/393845886/

Best to use the move block and check after each move or use a separate loop to detect collision.

Edit: Looks like you used the move block instead of the glide block in the other 2 sprites that work.

Last edited by mstone326 (May 30, 2021 23:10:16)


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
AmgenS
Scratcher
8 posts

Same Code on Different Sprite not working

say [Thank you!]

Powered by DjangoBB