How do I make this event simple?

0 favourites
  • 7 posts
From the Asset Store
Publish and Subscribe to events in event sheets and from the scripting interface
  • i have many sprites about 50 sprites in 1 layout. and i want to get all of their x, y coordinate and put it into single array, this is my current event sheet, can someone help me to make it simple? i dont know what to do.

    prntscr.com/iqg4rv

  • Start with array size 0,3,1

    + System: On start of layout

    + System: Repeat Sprite.Count times

    -> Array: Push back 0 on X axis

    -> Array: Set value at (LoopIndex, 1) to Sprite(LoopIndex).X

    -> Array: Set value at (LoopIndex, 2) to Sprite(LoopIndex).Y

    This will only work if they are all instances of the same object.

    If you need to do so for multiple sprite objects, put them all in a family and replace "Sprite" with the family.

  • Start with array size 0,3,1

    + System: On start of layout

    + System: Repeat Sprite.Count times

    -> Array: Push back 0 on X axis

    -> Array: Set value at (LoopIndex, 1) to Sprite(LoopIndex).X

    -> Array: Set value at (LoopIndex, 2) to Sprite(LoopIndex).Y

    This will only work if they are all instances of the same object.

    If you need to do so for multiple sprite objects, put them all in a family and replace "Sprite" with the family.

    so i cannot make it simpler?

    all of my sprites are round circle with text on top of it, when i click it another sprite appear on top of it.

  • Not sure how you can get simpler than a single event.

    For clicking it and spawning another sprite on top, you don't even need to store the x/y of every sprite in an array, you can just use the sprite "spawn an object" action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure how you can get simpler than a single event.

    For clicking it and spawning another sprite on top, you don't even need to store the x/y of every sprite in an array, you can just use the sprite "spawn an object" action.

    can you help me with this.

    there are 10 sprites, when i left click the sprite, another object appear on top of it, i dont know what is the event in C2, the logic is.

    -> Every left click on each the 10 sprites

    -> Make an object appear on top of it.

    for now, i store their X dan Y, and then make 10 event for each sprites.

  • Use the spawn action.

    https://www.dropbox.com/s/ja0rqjzkexlxx ... .capx?dl=0

    thx for the information about families.

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