Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
var r = 1000;
for(i=0; i<r; i+=1;)
{
instance_create();
}
^^^ Basically, if the object isn't overly scripted, Game maker would semelessly create a 1000 of them with this method.
Do you know what the difference is in the implementation of repeat() and a for loop? I'm curious why there would be a performance impact, or is this just some practical experience or similar.
If you need 10 instances in the same position, you should use a repeat() loop.
While[docs.yoyogames.com] loops are just for loops that keep executing until the if part is false.
For[docs.yoyogames.com] loops are while loops that allow you to set and manage a variable in a consice and readable manner.
Do[docs.yoyogames.com] while (or do until) is just a while loop that is garunteed to run at least once.
Repeat[docs.yoyogames.com] loops are just blocks of code that repeat a given amount of times. As Seabass mentioned, repeat loops are fastest, so use those if you have no need for an iterator.
EDIT: I missed a loop, the with loop. With[docs.yoyogames.com] loops are loops that execute code within all instances of a specified object.