xstart

The starting x position of the instance.

Syntax:

xstart


Returns: Real


Description


This function stores the initial position of the instance when it is first created. You can also set this in code to the value that you wish.


Example:

if place_meeting(x, y, obj_spike)
   {
   score -= 100;
   x = xstart;
   y = ystart;
   }

The above code will check for a collision with an instance of "obj_spike" and if there is one, it deducts 100 from the score and moves the instance back to its starting position.


Back: Moving Around
Next: ystart
© Copyright YoYo Games Ltd. 2018 All Rights Reserved