How do I - make repeat or loop for several actions?

0 favourites
  • 7 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • Here we go again, I have another issue right now.

    I have problem about repeating several actions.

    In my event sheet, it goes like this:

    {I want to make repeat/loop from here}

    (event) System: on start of layout > (action) stop animation

    (event) Mouse: on left button clicked on object > (action) animation start

    (event) System: Time = 4 seconds > (action) create object

    {to here for the repeat/loop}

    NOTE: The system time is for waiting from mouse clicked until the object created.

    This several actions that I want to repeat/loop but I can't figure it out.

    Any Advice? I'm blank right now

  • What are you trying to do? Wait for the player to click? You don't need a loop for that.

    You can repeat a action with the system events "Every tick" or "Every Second". The loop you are going to use when you have a determined amount of repetitions you want to execute.

    Sorry if I can't be clearer but I didn't quite understand what you are trying to do LOL

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what are you trying to do too. Why do you want to repeat "on start of layout" trigger? These trigger usually placed in front of the other condition, example:

    on start of layout {
    	stop animation;
    }
    on object clicked {
    	start animation;
    	wait 4 seconds {
    		call function create_object();
    	}
    }[/code:16cjfw88]
    All those codes above inside the event sheet is repeated every tick by system default.
    
    You're asking about repeating several actions, but your illustration in the first post shows like you're repeating several condition.
  • To RayKi & tmntppn

    Sorry before for being unclear with my post. I'll try now to make it clearer.

    Due to the game that I make is about restaurant, I have an object of frying pan that animated for few seconds (animation initial state of this object is disabled).

    At start of layout, I want to make the frying pan to animate first, then after animation finished or stop to animate, it spawns another object as results (this is like when you cook for few minutes, it will result the dish).

    Then, if I click again in the frying pan object, it will animated again, and repeat resulting another object as result (or you could say the dish).

    That's what I want to repeat all over again.

    I hope that it would make it clear to you, guys.

    I have try the condition in my first post but it didn't work at all.I have no idea what's going on or what's wrong with mine. It was killing me, guys.

    Hope that you could help me a bit and lifting my burden.

  • Like this: https://www.dropbox.com/s/8l97n86okvolr5c/cook.capx?dl=1?

    • Click the grey square to start cooking.
    • Once cooking is complete, a red box is spawned (the dish).
    • Remove the dish from the pan (drag the dish somewhere else).
    • When the pan is empty, click again to restart.
  • Like this: dropbox.com/s/8l97n86okvolr5c/cook.capx

    - Click the grey square to start cooking.

    - Once cooking is complete, a red box is spawned (the dish).

    - Remove the dish from the pan (drag the dish somewhere else).

    - When the pan is empty, click again to restart.

    Thank You tmntppn for your sharing idea but at the moment I'm working on another project so, this one I must hold for now, but when I'm done with it, I'll definitely come back to this project and observe your example capx.

  • Glad to help.

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