Repeat x times > call function and destroy actor on overlap

0 favourites
  • 6 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hey guys, im trying to make a function repeat "x amount" of time, this is set to a global variable. Everytime the function gets fired, it add to this number. This somewhat works, but somehow, in my case 10 times, spawns the double amount of instances.

    Thats ok for now, but my main problem is, i want the object getting destroyed, as soon as its spawned and overlapping with the same kind.If so, it subtracts from the "x amount".

    Also 1 planet is already placed at the start as a starting point for the player.

    I dont know where im making the mistake, sometimes construct events are confusing for me.

    Hope you guys can help me

    This version wont work either :/ im so lost

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can't use 'Planet: is overlapping Planet'. You have to put planet in a family and use:

    + Planet: Is overlapping Family

  • So either im realy lucky with the spawns, or its working now !

    Well it was luck >.< Still not working

  • Looks like you are just trying to spawn a variable amount of object without overlap.

    check out this post: construct.net/en/forum/construct-3/how-do-i-8/two-objects-dont-spawn-place-173226

  • Works for me:

    + System: On start of layout
    ----+ System: Repeat 50 times
    -----> System: Create object Planet on layer 0 at (random(0,ViewportRight(0)), random(0,ViewportBottom(0))), create hierarchy: False, template: ""
    --------+ Planet: Is overlapping Family
    ------------+ System: Pick last created Planet
    -------------> Planet: Destroy
    
  • Thanks for all the help !, but nothing looks to work as intended, i will give up on this :P if this isnt managable for me, i cant even think about going even more indepth with logic

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