You guys are very often writing this:
(just an example)
- Code: Select all
int i;
for (i=3;i<100;i++)
I understand, you made variable "i" and you put it in "for cycle". But how to use it? Can someone explain me how to use it?
Thank you.
int i;
for (i=3;i<100;i++)
int i;
for (i = 0; i < 10; i ++)
{
if (array[i] == 5)
{
//action here
}
}
if (array[0] == 5 || array[1] == 5 || ...)
int i;
for (i=0;i<100;i++) {
do loop here
}
Hblade wrote:Yeah LCL I know you explained it already so I gave you a point I didnt see your post, sorry about that xD
lcl wrote:Or that's how it should work..
It gets slow sometimes, if you do much things.
Like my random level generator.
If you make it to create something like 5000 platforms it takes longer than 1 frame.. xD
Game A Gogo wrote:lcl wrote:Or that's how it should work..
It gets slow sometimes, if you do much things.
Like my random level generator.
If you make it to create something like 5000 platforms it takes longer than 1 frame.. xD
Wrong! The frame just takes longer to process, because the CPU is overloaded. But it will still remain a frame, and everything else will "pause" for that process to finish. If you wanted to the loop to be produced over several frames, it'd make it less laggy but maybe more "choppy". An exemple that I could state would be my P2040 level editor where it draws a line of tiles per frame instead of the whole thing at once.
Users browsing this forum: No registered users and 1 guest