Spawn a shape or object whenever the initial object reaches a specific locaton

I have an ellipse moving across the screen with

redBallX = redBallX +1;

I was wondering how I would make it so that when the X value of the ball hits 50 pixels across the screen as the initial value of redBallX = 0 so when the value reaches 50 it spawns in the exact same object?

1 Like

Hello @NotConsumable,

Please do not start a new thread to ask follow-up questions:

1 Like

This reminds me of my reply to your last post. Why do you start a new discussion?`
Please post your entire code (of program 1 and of program 2)

in program 1 still
within draw() function

redBallX = redBallX +3;   // FASTER NOW 

     redBallX = 20;


1 Like