Multiple Same Objects

Hello! Apologies in advance for the lack of visuals. I’m new to this, and for now, I’m focusing on getting the mechanics right before adding the visuals. I’m trying to make a game similar to “One Finger Death Punch,” where enemies appear from the left or right. Currently, I’ve been using bananas and watermelon slices instead of enemies to test the mechanics. When I right-click for objects on the right side and they are within the designated range, they disappear and I earn points. However, if I don’t click or missclick when no object is in range, I lose one life point.

The problem I’m facing is that if I right-click when an object is in the correct range, but there’s another object outside the range, I end up both earning points and losing a life point simultaneously. I want to lose a life point only if no objects are within the correct range.

PS. For now, I’ve been using bananas and watermelon slices instead of real enemies. :smiley:

Sometimes, instead of inverting a collision condition, you need to use the NOT condition. It’s in the same section as the trigger once.

Try adding the NOT condition and put the collision condition inside it. (do not invert the collision condition)

It sounds the same but NOT inverts the result while inverting a condition inverts the condition. Yeah, it can be confusing but you get used to it.

Other times, you might be able to just swap the position of the objects names in the collision condition.

That coin you see right from score is placed in editor and needs to be there to properly reset bullet to proper tint and opacity each time
Like event needs to check if bullet is not in collision with coin1
BUT if coin1 does not exist then event can’t check anything
That is why that coin needs to be ANYWHERE on your scene
You can even set its opacity to 0 in editor or use action to simply hide it at beginning of scene
In your case my bullet is your NewTiledSprite
Where my coin1 is your Banana

@Keith_1357 of course i tested NOT and it didn’t work for me idk why
But since this work then who cares

I removed the banana from the scene and then worked with what @Keith_1357 suggested. Thank you both!

1 Like