Thread: Chaos
View Single Post
  #15  
Old 06-08-2001, 06:10 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by grim_squeaker_x
NPC Code:
if (playerenters||timeout) {
for (this.i=0;this.i<64;this.i++) for (this.j=0;this.j<64;this.j++) {
this.a=int(random(0,16));
this.b=int(random(0,255));
board[this.i+64*this.j]=this.a+16*this.b;
}
updateboard 0,0,64,64;
timeout=0.05;
}


Put that in a level and then you've got even more chaos.
I'd change it from iterating through the x and y to iterating simply from 0 to 4095. Like so:

NPC Code:

for(j=0;j!=4096;j++){
board[j]=int(random(4080));
}
updateboard 0,0,64,64;
timeout=0.05



Only slightly shorter

[edit]Stupid UBB code! Had to change my i to a j![/edit]

Last edited by Kaimetsu; 06-08-2001 at 06:13 PM..
Reply With Quote