What is the gml code of MOVE FIXED in the game maker?

Asked

Viewed 83 times

0

I wonder how the function moves Fixed in gml (game maker language):

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

I found some similar moves with which I can do some "gambiarras" for them to act the same way as the move Fixed, but if the move Fixed exists in the "actions" it certainly exists gml code.

1 answer

0


Well the solution is really quite simple.

When I asked the question I was wanting there to be a randomization in the direction in which the object was (left/right) after colliding with one another, this can be done with the 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 if the application is "selfie" this indication is necessary object.x (+ ou -) 10 and not only x (+ ou -) 1 to be relative to its position.

The y is the opposite of conventional. With - goes up and with + if it goes down.

Where does the image begin? I imagine you thought that in the upper left corner, ready is why. The point 0, 0 (x , y) is in the upper left extreme, so any value down or to the right side increases its value.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.