I cant get the coordinates using current x, y dragged ball block

i am trying to get the coordinates x,y of the movement between two balls using the collider with each other and the block dragged ball with the current x and y but only get one value x,y static in the label results. why?. if the ball is in movement using move to and point in direction like this

945d26aa9ddf347f5233f4de8d803101863cac82

when imagesprite1 dragged

Dragged event is only triggered if you drag the sprite/ball.

i am guide me using this post Move to a point(x,y) smoothly

i am finding to get the coordinates without using the clock component. its a project that i try to make.

maybe you can guide me what block can i use to make that please. thanks a lot

In that example you can drag the sprite and when click the button it will move until the ball.

I think you need a clock to get the coordinates of the ball, unless some event (dragged, flung, collided...) is triggered.

so no exist a block to make that. to get movement with label coordinates x and y between two balls wihout use a clock.

maybe using edge reached can get the movement coordinates x,y from the sprite or ball?

You could try something like this:

The black ball moves faster than the red ball, so it collides with it, providing an event to capture the coordinates, and move the red ball away from the black ball, so that it can be collided with again.

You could make the red ball with no colour so that it does not show.

Quick Example Aia Project
canvasrecording.aia (2.8 KB)

its working but now i have a other problem and its i am using the touchdown and touchup button for start and stop the movement of the balls but not working

image

canvasrecording(1).aia (3.2 KB)

a61c978b6e70d73ecb5fffd386fb07e26b86193e
What is this supposed to mean?

sorry thanks for see my error now its working

image

i have other question how can make that the value start from 1? i am changing the values of ball1 x and ball 2 x that when collided get starting in 1 but i cant, always start in 30

image

But you are showing Screen Initialize, not the colliding event?

the colliding event is this
image

So there must be a 30 somewhere, right?
Keep looking.

Because ball1 is colliding with ball2 on screen initialise (setting the X of both balls to 1 will cause a collision), so ball2 jumps to the right :wink:

You will need to include some if conditions in your collide event to prevent the handling of the collision if X values are less than the number you choose.

1 Like

i understand your answer but i dont understand why i am getting the 30 value between balls but i try to change the values for that.

Try reducing the radius of the leading ball, you can reduce the gap that way?

my intention about this is not use clock but i cant to work to walk the sprite using this blocks
image

image
image

only works pushing constantly the touch down but my intention its to work with one push in the button
canvasrecording(2).aia (7.7 KB)