Discuss Scratch

allahmark
Scratcher
2 posts

Detect if touching 2 sprites at once?

In a game i'm working on you can eat tacos, and sometimes you eat multiple at once but, my code doesn't do what I'd like it to do…

All the tacos have the code below in them, when I eat them, all the ones i'm standing on disappear, but fat only increases by 1…

Also, the fish have this code in them:



I want fat to increase for each taco eaten…. but that's not happening, any help would be awesome!

My project:
https://scratch.mit.edu/projects/186956382/
Script_Helper
Scratcher
100+ posts

Detect if touching 2 sprites at once?

1st make a variable ‘fat’ (both fishes) a public variable, 2nd try this:
when I start as a clone
show
if <(pick random (1) to (5)) > [2]> then
go to x: (pick random (-214) to (-119)) y: (pick random (-89) to (-120))
end
forever
if <<touching [Fish1 v] ?> and <key [e v] pressed?>> then
change [Fish1: fat v] by (1)
end
if <<touching [Fish2 v] ?> and <key [o v] pressed?>> then
change [Fish2: fat v] by (1)
end
end
change this to every tacos and you'll see it works.
I hope it helps
allahmark
Scratcher
2 posts

Detect if touching 2 sprites at once?

thank you!!

Powered by DjangoBB