[ Solved ] How do I use system repeat?

0 favourites
  • 14 posts
From the Asset Store
Create complex dialogues with ease with this tool/template!
  • Hi there,

    I have 2 sprites, first sprite spawn sprite two every 1 second, and I want the action just do 4 times, means just spawn the second sprite 4times, but when I add the system ->repeat count 4, it not works, it keep spawning, never stop, so how to spawn object in a given times? thanks

  • Uh, Try "System-Trigger Once"

  • usman Haq trigger once is not work

  • How about

    https://db.tt/w2JvnwL7

    (r211 beta)

  • You could do something like this:

  • phimaka - perhaps instead of using a global variable updated every tick you would be better using :

    although perhaps I should have called the group "less than five missiles on screen at once method"

  • edited the above capx - perhaps a bit OTT ?

    https://db.tt/9012BJud

  • RamPackWobble The way your doing it is a better programming practice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • try using a variable.. the repeat X times.. its just gonna respawn as many missile as you tell it to multiplied by 4

    in order to stop spawning it... after it spawned 4 times.. considering there are no other similar sprites on screen... you can do a condition check... that counts how many sprites of the same type are on screen... Example :

    Condition - when mouse click -(or every 1 second how you want to be)

    - if sprite.count<4

    Action create actor sprite at x y

    that means every 1 second if the missle count is less then 4 will automatically create another 1 till are 4 on screen... hope it helped you...

    you can disable the condition triggering by placing it in a group and enable the group when you want it to happen...

    lets say if Spacebar is pressed Set group shootmissile active

    if sprite.count - greater or equal with 4 ... Set group shootmissile disabled

    you can also do it by using a boolean its same thing.. just you'd have to say when spacebar is pressed set boolean to true...

    and when the count of the sprites is equal or greater to 4 set boolean to false

    now if you want the sprite when spawned to have a delayed space between them if you dont know how to count the space in pixel.. you could calculate it visual by adding a wait period... of 0.5 lets say and let the whole creating system you just created to happen every tick.. with a delay of 0.5 between each creation of a sprite... that way youl have all sprites spawning at different spaces from each other... and you wont have to worrie about them overlapping...

    hope it helped you, and i hope i was in the area of your question. please add [ Solved ] in title of the topic if its already Solved laoniustudio

  • thanks all of you, RamPackWobble it works well, thank you.

  • thanks , it works well, I have change the question to solved, thanks

  • would you please tell me where to change the title of the post, did not find how to change

  • would you please tell me where to change the title of the post, did not find how to change

    edit the original post you did here... the very first on 1st page then change the title from above

    make sure its in advanced editing

  • got it thanks

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