Help with repeated Events/Actions for different instances of the same object

0 favourites
  • 4 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hi everyone, I need some wisdom. Today I spent around 4 hours trying to figure out how to apply a set sequence of events that effect each instance of an Object. I eventually found a solution but I'm sure it wasn't the most efficient one.

    What I needed to do was make each instance of an object invincible when the instances' animation frame was between a certain range (in this case, frame 74 and 286).

    This was the events that I set up, which would work when there was only ONE instance:

    Using a repeat loop, I would be able to create 12 instances but the events would no longer work properly (which I expected). It was like most of the instances would become invincible at the wrong time.

    I tried numerous work arounds and play testing, hence the 4 hour process. Eventually

    I found the following solution:

    I avoided doing it like this because for some reason, I felt like it's the least efficient way of doing what I needed, and my problem was a lack of understanding of Construct 3.

    So, even though I have a method that works, can anybody give me any pointers on how to work with instances with more efficiency?

    Cheers everyone and have a lovely day, and if anyone asks for it I'll try and link my project, I actually don't know how to do that at the mo :)

    Daryl

  • Have you tried 'For each' in System?

    Something like that:

    + System: For each BossTargets

    ----+ BossTargets: Animation frame = 74

    ----+ OR BossTargets: Animation frame = 286

    -----> BossTargets: Set collisions Enabled

    ----+ System: Else

    -----> BossTargets: Set collisions Disabled

  • Hi Asmodean,

    I tried a ton of loop based things, and I think I didn't use For Each. Most likely because I've misunderstood what it does. I'll give it a go and let you know if it works :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Asmodean, thankyou! I wish I had asked sooner :)

    It's true that I thought For Each worked in a different way than it does, which is probably why I ignored it. Foolish! lol

    Thanks again and all the best!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)