When sprites collide, detect which part of sprite?

I’m making a watchable game where lots of ball sprites climb up a mountain while a fog rises from the ground and any balls touching the fog are destroyed.
When a ball (a) lands on top of another ball (b), ball (a) bounces up and ball (b) is knocked sideways off the mountain side little.

The software i’m using lets me make 2 different clone sprites at the same time and has them linked together.
So i can make “FEET” for a Ball sprite.
Then code when FEET collide with a Ball, have the FEET jump (since a Balls connected to the FEET, the BALL linked will jump as well)

I know you can manually link 2 sprites together with some behaviours in the editor using READY,
But could clones of 1 sprite be mass produced with a second type of clone attached to it using code in READY?


Thinking about it, i thought of a possible way to do this.
When clone (A) and clone (B) are created, have clone (B) check if it’s counter is equal to clone (A)'s counter.
If it is, have clone (B) forever set position to clone (A) position.

Clone (A) will have to be drawn so it’s bottom half is deleted , then clone (B) will look like it’s sitting at Clone (A) bottom.
I wonder how much performance this would drain from READY.


@Suzzy-Grey - An interesting solution, at the moment, it looks a little complicated logic. But we are now working on creating a new type of groups for the objects. When it is ready, we can create more the complex conditions for a group of the objects. Using different settings for the objects in the same the group.


In the update coming, can COUNTERS be compared with other COUNTERS?


1 Like

Hi @Suzzy-Grey - No, at this point in time for this, you can try to make logic using global variables. With a large number of objects on the stage, this can be problematic. You can try to use the polling system. In it, we do not clone objects, but rearrange existing ones. At the moment we are working on improving the performance of objects in the classroom. I think soon we are waiting for a wonderful update, which will significantly expand the work of objects in the classroom. At the moment, we need to use more events for complex logic.

1 Like