Home | Customize | Blog | Extras | Log In | Info
Manual | D&D icons | GML Parser | Archive | Iso City
Username: Password:  
About | Features | Directory | Banners | Contact

Designing Games with GameMaker
Designing Games with GameMaker

Do statement

A do statement has the form

do <statement> until(<expression>)

The statement (which can also be a block) is executed until the expression is true. The statement is executed at least once. Be careful with your do loops. You can easily make them loop forever, in which case your game will hang and not react to any user input anymore.

Example
The following program tries to place the current object at a free position (this is about the same as the action to move an object to a random position).

{
  do
  {
    x = random(room_width);
    y = random(room_height);
  }
  until (place_free(x,y))
}

Search Search


Alternative versions Alternative versions

You can also read this manual on one single long page (± 1.5 mb)

Also available in: Dutch French German

ZIP Download helpfile

Advertisement Advertisement

GameMaker Manual