Quote:
Originally Posted by Trakan
Thanks  , but, this
player.x += 0.1;
sleep .1;
player.x += 0.1;
sleep .1;
player.x += 0.1;
sleep .1;
player.x += 0.1;
it's really ugly
Any way to change that?
|
Use a
for() loop to clean up this code. Repeating code is most always a bad thing, especially in one instance after another.
ex:
PHP Code:
for (temp.i = 0; temp.i < 4; temp.i ++) {
player.x += 0.1;
sleep(.1);
}