View Single Post
  #7  
Old 12-24-2012, 05:29 PM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
Quote:
Originally Posted by Trakan View Post
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.0temp.4temp.++) {
    
player.+= 0.1;
    
sleep(.1);

Reply With Quote