Discuss Scratch

Thisisforschool68
Scratcher
10 posts

Clone Enemy Hitboxes

Can someone help me make code to identify if one clone is touching a clone of another sprite and on which side.

For example I have a ball that moves but I need to detect if a clone of the ball touches the bottom of an enemy's hitbox vs the top or side that is also a clone.
not_electric_ajax
Scratcher
98 posts

Clone Enemy Hitboxes

In the ball sprite:
forever
if <touching [enemy v] ?> then
broadcast [hit v]
wait [0] seconds
delete this clone
end
end

Then in the enemy sprite:
when I receive [hit v]
if <touching [ball v] ?> then
take damage
end
Thisisforschool68
Scratcher
10 posts

Clone Enemy Hitboxes

Mate that doesn't help like at all

(1) I'm not trying to delete the ball
(2) You can't use if touching for clones
(3) That literally doesn't even address the most important part which was the side detection
(3) * is the last part stop spamming
Thisisforschool68
Scratcher
10 posts

Clone Enemy Hitboxes

The ball should bounce off the enemy but with the physics im using I need to know where on the hitbox it hits in order to get an accurate bounce.

Powered by DjangoBB