Two sprites overlap each other. If I click on one of them sprite specific actions happen. Problem: If I click in an area where both sprites overlap the action of the bottom sprite is performed.
Possible solution: Create an array. All touched sprites will be listed in one column and their layer in another column. Now sort the list by layer and choose the object with the highest layer. Now perform just the actions for that object.
Are there any better solutions? If no, how would I create such an event in CS2?