Single button to tween multiple objects

Completely new to GDevelop but wondering:

How do I…

Move 10 sprites (which are identical) from offscreen positions to onscreen positions (each different) one-at-a-time using subsequent presses of a single button?

What is the expected result

After each button press, we tween the position of one of the sprites, then wait for the next button press then tween the next.

Any help in conceptualising how to do this much appreciated.

Welcome to GDevelop!

Do these sprites tween to the same place on screen, or each one tweens to a different position?

Also to where are they tweening to? To another object, or the center of the screen or a certain X & Y etc…

Are they in a vertical line and do you want to move them top sprite first to bottom sprite last? Then:

  1. add an additional object (say called “Checker”) to the scene and place it off screen above the top sprite.
  2. add the “Object is on screen detection” extension as a behaviour to the sprite object
  3. when the button is clicked, find the sprite that’s off screen and closest to “Checker”, and tween it.

each would be tweening to it’s own individual X,Y

An interesting solution for sure! I will require a subsequent move for each after this, so not sure if this could work for that too.

@MrMen’s solution is great. However I had a different approach in mind and I’ll share it as well.

Add a number variable (let’s call it “num_var”) to each instance of the object from the instance properties panel to be in the order of which you want to animate (1,2,3…10). So the 1st object would have num_var = 1, 2nd object has num_var = 2, etc.

Event:

No you won’t. You just need the condition to check if the button is clicked, then find the offscreen sprite sprite nearest the Checker object. This event can be repeated until all the sprites are on screen.

The thing about this method is that you can change the number of sprite objects without having to change any events or (correctly) set the variables of the sprites.