Using "OR" or group of objects[SOLVED]

I need to decide what method to use.

  1. Conditions
    or :
  • “Hero” is in collision with “Object1”
  • “Hero” is in collision with “Object2”
  • “Hero” Delete
  1. Conditions
  • “Hero” is in collision with “Objects” ( Group “Objects” = Objects1 + Object 2)
  • “Hero” Delete.

What is the real difference ? What will be better to use?

Go with method 2. My reasons :

  1. Method 1 requires more work and events to refer to the object Hero collided with in any of the subevents, particularly as you get more and more objects.

  2. With method 1 you need to remember to add a new condition whenever a new object is added. Nothing bad, but annoying if you miss it and spend time debugging something you shouldn’t need to.

  3. From a simple test project I made to check the speeds, method 1 is about 2.5 times slower. But we’re talking fractions of a second here - the time differences were only visually noticeable after in loops of more than 1,000 iterations.

  4. Method 2 is cleaner, making it easier to read and maintain.

1 Like

And about your game (is long or short) you need know, every single event you put in code is more bytes need the JSON (game file)

Thank you a lot!////