Quote:
Originally posted by Soul-Blade
Bleh, sounds boring.
|
What would you recommend to be taught under the Advanced section?
Quote:
|
Kai, what is with you and precalculation anyway? Either way, graal must calculate it, whether precalculated or not, precalculation just adds another few bytes to the memory
|
Evidently you don't understand the principle behind it (probably a good reason to attend the class

).
BAD:
NPC Code:
function drawLights(){
for(i=0;i!=lightcount;i++){
showimg ic,light2.png,this.lightx[i],this.lighty[i];
changeimgcolors ic,1,1,1,sin(this.time)*(1/this.ambient);
}
}
GOOD:
NPC Code:
function drawLights(){
temp=sin(this.time)*(1/this.ambient);
for(i=0;i!=lightcount;i++){
showimg ic,light2.png,this.lightx[i],this.lighty[i];
changeimgcolors ic,1,1,1,temp;
}
}
You can't see that the latter is more efficient?