Collision between 2 created sprites?

Hey!

I’m trying to make a Space Invaders type game, in which i have a sprite that is a shot and another one that makes up the enemies.

I have it set so that when a looping timer goes off a shot is created, and when another looping timer fires an enemy is created.

I want both of these created sprites to hide whenever they come in contact with each other, but i don’t know how to proceed. Is this possible? If so, how can i do it?

Thanks in advance!

You can Use the is Sprite collided block for that.

When i try to use that block, i cannot use the component variable inside the hide function because it tells me it’s out of scope.

Post a screenshot of the blocks you’ve tried.

1 Like


Use this block.


this is what i’ve tried so far.

Replace component with one of the collidee blocks

3 Likes

Right. You can’t use a green block outside of its “when” container block.

2 Likes

Yep

Thanks a lot!

1 Like

You’re welcome