Well the solution is actually quite simple.
When I asked the question I was wanting a randomization in the direction in which the object was (left / right) after colliding with another, this can be done with if.
if (condiction01 == true){
//ir para a direita com a velocidade 10
move_towards_point(object.x+1,y,10);
//valores positivos adicionados a x, o levam para a direita na horizontal
}else{
//ir para a esquerda com a velocidade 10
move_towards_point(object.x-1,y,10);
//valores negativos adicionados a x, o levam para a esquerda na horizontal
}
Remembering that even applying "selfie" requires this indication object.x (+ ou -) 10
and not only x (+ ou -) 1
to be relative to your position.
y is the opposite of conventional. With -
goes up and +
goes down.
Where does the image begin? I guess you have thought that in the upper left corner, that's it. The 0, 0 (x, y) point is in the upper left corner, so any value down or right increases its value.