How do I loop?

0 favourites
  • 3 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • Hello, everyone,

    I would like to add a boss fight to my game. The boss should simply repeat the sequence of actions you see in the picture as long as his lives are greater than 5000. However, I can't do that with the loop. How can I tell him to repeat this sequence of actions as long as his lives are greater than 5000? The sequence of actions also states that he should spawn a "LackBlase" and a "BigLaser", but he should only spawn 1 of each.

    Would appreciate your help.

  • You can achieve what you want using states and timers.

    Use an instance variable on your boss, called state.

    If state = fighting and BossHP > 500 -> Do all your actions and change the state of your boss instance variable to waiting, also start a timer, this timer is the time that your boss are going to stay idle...

    On Timer -> set your boss.state back to fighting

    So it will loop till BossHP are less or equal to 500 with some time between actions

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you, I have now solved the problem like this:

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