Why do multiple instances of an object appear to rely on each other to fulfill their own conditions?

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • I've got this object called a Death Mine (very clever, I know) that explodes after a delay when stepped on. The delay is determined by an instance variable called detonate. When the mine is stepped on, its animation switches to one with a flashing light. Every time the frame switches to 1 (the frame with the light), it should increase the detonate variable by 1. When "detonate" reaches 10, the mine explodes. However, when multiple mines are activated and all of them are flashing, they only increment their own detonate variable if every active mine hits frame 1, rather than just themselves. This means that if multiple mines are activated and their animations are not in sync (95% of the time), they will never explode because there is no point at which every mine's frame is 1.

    I can't tell why they are acting like this, because as far as I know the variables, conditions, and expressions that I used are supposed to be able to only apply to singular instances, so I'm not sure why they seem to be reliant on each other to succeed. I am not entirely sure if my diagnosis of the problem is correct, so I've attached the C3 file for you all to dissect.

    drive.google.com/file/d/18kjYnyoZ50AB_g5AkxUqO0riz0JoYfHs/view

  • The “trigger once” is throwing it off. Basically they all need to not be frame 1 before the event can run again.

    I’d do the logic under a “on frame changed” condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That worked perfectly, thanks!

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