Y-Position Triggering Issue

  • How would I fix this code so that it would work with individual enemies as opposed to it only working when detecting the player being at ALL of the objects' Y positons?

  • Give the enemies an identification code (on creation) by use of an instance-variable. Then add an event that checks that instance-variable.

    By instance. Give the enemies an instance-variable 'id', make it 'text'. Give 'id' a value when you create enemy. First enemy, value = "Peter". Second enemy, value = "John" and so on ....

    Then add a condition thogheter with the Y-checking: instance-variable of enemy = "Peter" > do this

    Dont have to be text, ofcourse, it is just easy to explain that way.

  • Would there be a good/feasable way to have it so I wouldn't have to manually give events/rename the IDs of the springers? I've tried setting the IDs to the UIDs of the objects, but that doesn't seem to work.

  • Put a "Foreach Springer" in front of each, so you pick each item individually. Don't separate out the "set alerted" from the frame & speed actions, do it at the same time (and possibly get rid of the alerted).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Put a "Foreach Springer" in front of each, so you pick each item individually. Don't separate out the "set alerted" from the frame & speed actions, do it at the same time (and possibly get rid of the alerted).

    Thank you very much! Issue solved.

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