View Single Post
  #3  
Old 11-27-2007, 11:48 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
PHP Code:
function bucketfill(fx,fy,ft) {
  
// fill x, fill y, fill tile
  
temp.rt tiles[fx,fy];
  
tiles[fx,fy] = ft;
  
updateboard(fx,fy,1,1);
  for (
temp.i=0temp.i<4temp.i++) {
    
temp.tx fx+vecx(temp.i);
    
temp.ty fy+vecy(temp.i);
    if (
tiles[temp.tx,temp.ty] == temp.rt)
      
bucketfill(temp.tx,temp.ty,ft);
  }
  return;

I can change this to flood a pattern if you wish, I just need some more details about it (a random tile of several or a pattern?, etc.).
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote