SetSpritePosition(spriteID, GetSpriteX(spriteID)+1, GetSpriteY(spriteID))
That is one way, where that is moving the sprite on its X axis 1 pixel each cycle.
Of course that could be any number you want, and you could do the same for the Y axis if you wanted.
If you Know the fixed value for Y then you could just use that like...
SetSpritePosition(spriteID, GetSpriteX(spriteID)+1, 200)
But the first example just reads whatever it currently is already set to in case it has already been adjusted by something else.
You can do a -1 instead of +1 to move the other direction, and you want to have some kind of limit, so putting that in an IF statement that checks the position would be best.
That way you will not keep moving it until it gets out of bounds and causes an error.
In your case you would have a couple of variables that are representing the fixed point you want to move to for the X and Y.
Then, the IF statement(s) would compare the sprite's current X & Y positions to the desired location variables and then increment or decrement the position accordingly.
If GetSpriteX(1) < desired_x
move_it = 1
else
move_it = -1
endif
do
if GetSpriteX(1) > 0 and GetSpriteX(1) < 700
SetSpritePosition(1, GetSpriteX(1)+move_it, GetSpriteY(1))
endif
sync()
loop
That limits it between 0 and 700 so you will not go out of bounds, so if the desired_x is 100 or 400 and you current position is 200, then it will move you in that direction and beyond it, but still stay in the limits.
Hope this makes sense and helps, and I am sure someone else will now tell you a better way to do it.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1