y (Game Maker)


( Game Maker 6.1, 7 )

y - the y-location of an object in a room.


y is an object's y-location or vertical position. In 2D, the y-location is counted in pixels. Even though y can contain a number with a decimal fraction (i.e. 5.2), it will only take into consideration the whole part of the number.


Example of Use

y contains the vertical position of an object in relation to the current room and never the view. If you wanted to put an object 50 pixels from the top side of a room, you could use the below code.

y = 50;

Random y-location

y = random(room_height);

See Also



Similar To

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.